View Full Version : php gd library ?
buggedcom
04-23-2003, 01:16 AM
hey backend people, this is not urgent or anything, but i was wondering how easy it would be to pass objects / vectors from flash to php for use with the gd library to convert an image to a watermarked image. It's for use with my imageweaver component with the forcedown feature, i know it would be possible to pass a string for watermarking, but wondering if it was possible to pass a vector or design to php. I pressume if it was it would be a series of arrays containing points and values.
has anybody done anything like this that they could contribute to the imageWeaver. you would get full credit in the interface and the reference panel files if you could help.
if not are there any good resources out there that you could point me in with this type of setup, any examples fla's that you know of?
freddycodes
04-23-2003, 01:26 AM
Well first thing, don't use GD, use imagemagick. The quality of the images after being done up with Imagemagick has proven much better to me every time I have used it. There was a thread a while back which I wrote some code for taking my drawing app and exporting the image to PHP, which used PHP to create a PNG for download. I'll see if I can find a link, but what would you want to do, just layer another watermarked image over the original and force the download after?
buggedcom
04-23-2003, 01:37 AM
ah freddy to the rescue, i thought you might respond ;)
ok, but isn't imageMagik perl? i would preferably prefer to use a php option purley because i don't have access to a cgi bin, but if you rekon that's the way to go then fair play.
about that combining imgs suggestion. do you mean having the watermark in say a transparent png24 to compress it ontop of the selected img? or do you mean just have watermarked imgs already made of each img?
freddycodes
04-23-2003, 01:41 AM
I assume that means your host has PHP installed with GD support? Imagemagick is C I think, there are some PERL libraries, but essentially its a commandline tool, you can call it from PHP, but I didn't realize you were on shared hosting, that may be a bit of a problem. Check with your host to see the availability of Imagemagick.
I think the first option is best. Have a small watermark graphic. Use Imagemagick or GD(if you must) to blend the two together and spit them back out for download.
buggedcom
04-23-2003, 01:54 AM
http://www.buggedcom.co.uk/test.php
i think it does have gd, and although it's shared i will be getting another host in the next few weeks which will have everything, (hopeful|y). so if imageMagik is c, what does that mean? what do i need for that?
freddycodes
04-23-2003, 04:54 AM
I meant its a c program that runs from the commandline. So in PHP you might call it like
exec("/usr/bin/mogrify 150x150! /path/to/someimage.jpg /path/to/somethumb.jpg ");
So you see its a standalone program which PHP can make calls to.
buggedcom
04-23-2003, 04:58 AM
ah ok. i can probably test it from my server on mac os x then.
freddycodes
04-23-2003, 05:07 AM
Yeah I don't know about Mac OS X, I am pretty sure it only runs on Windows and Unix.
CyanBlue
04-23-2003, 05:10 AM
Yup... I had no problem running ImageMagick in Unix and Windows... But I guess it should be working on Mac OSX cuz it's got that Unixish thing going in there, right??? :D
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.