Page 1 of 1
tif to png with GD2
Posted: Sat May 28, 2005 12:04 am
by hongco
Does anyone know how to convert tif to png on the fly with PHP using GD2?
I think imagemagick can do this.
Thanks
Posted: Sat May 28, 2005 3:39 am
by onion2k
GD2 can't open TIFF files. So either you'll need to write a PHP script to open them, convert the data to a string GD can read, and save that as a PNG .. or just use Imagemagick.
Posted: Sat May 28, 2005 12:49 pm
by hongco
hi onion,
i was wondering how we do that with GD?
Posted: Sun May 29, 2005 8:25 am
by onion2k
hongco wrote:i was wondering how we do that with GD?
Yes. And I told you.
Posted: Sun May 29, 2005 10:06 am
by phpScott
for clarification GD or GD2 doen't support tiff files.
Posted: Sun May 29, 2005 12:54 pm
by hongco
phpScott wrote:for clarification GD or GD2 doen't support tiff files.
exactly! and I already know how to do that with imagemagick, but the problem with imagemagick is that you have to allow system command in php and turn off safemode in php.ini ...
Posted: Sun May 29, 2005 12:57 pm
by onion2k
hongco wrote:phpScott wrote:for clarification GD or GD2 doen't support tiff files.
exactly! and I already know how to do that with imagemagick, but the problem with imagemagick is that you have to allow system command in php and turn off safemode in php.ini ...
So you know that it's not possible in GD2 .. yet you still posted the question.
Err..
Ok.
Posted: Sun May 29, 2005 6:07 pm
by hongco
you are a difficult one, aren't you? haha j/k
at some point in your life, you might be wondering...hmm...."I know this one could not be done by such and such way, but do I know that for sure..maybe someone out there just figure out the new way"
That's the reason why inventions get invented every single day.
Furthermore, do not under-estimate the value of discussion. My question may be asked again by someone? and the answer you gave me can help them too.
Get a beer and keep yourself cool

Posted: Sun May 29, 2005 8:45 pm
by Ambush Commander
It's public domain. I wonder why GD doesn't support it...
Posted: Mon May 30, 2005 9:29 am
by phpScott
if you have googled and checked out other php resources and there is no answer there, what do you want us to do for you? Google around ourselves and check. If someone here knew the answer they would post it.
Posted: Mon May 30, 2005 4:35 pm
by hongco
a useless thread, indeed. i am not here to argue with all non sense.
OP can lock it if you will.

Posted: Tue May 31, 2005 3:53 am
by CoderGoblin
is that you have to allow system command in php and turn off safemode in php.ini
Not necessarily. You could post files in a certain directory and have a batch/cron process perform conversions. OK you would potentially have a slight time delay if part of a "workflow" (i.e where the PHP copies the file to the directory) but it could be a potential solution.
Although not part of your question, but a I thought I'd mention it for completeness.. I have had problems with converting uploaded JPG to TIFF with ImageMagick (toggle doesn't seem to work) to be read on a Mac (Quark) due to Mac's requiring big-endian and Windows assuming little-endian. In the end I had to use the Tifflib library to correct it.