Forum Moderators: coopster

Message Too Old, No Replies

PHP Image Conversion Help.

php image conversion

         

PhaZZed

6:28 pm on Aug 10, 2007 (gmt 0)

10+ Year Member



Hi all,

I have spent the last age trying to create a simple image conversion class, and have just not been able to get anywhere. I am limited to using the PHP GD Library unfortunately, so image magick is not an option.

I have managed to convert from:

.jpg to .gif and .png

But I need to convert from:

.jpg to .bmp and .tiff

If anyone has any information or, well, absolutely anything that can help, it would be greatly appreciated if you would share your knowledge.

Thanks!

PhaZZed

10:57 pm on Aug 10, 2007 (gmt 0)

10+ Year Member



I see that jpg to bmp can be done with the jpeg2wbmp() function, just need to sort the .tiff format out now :)

jatar_k

11:31 pm on Aug 10, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld PhaZZed,

on this page
[php.net...]

I noticed in the comments

IE doesn't show TIFF files and standard PHP distribution doesn't support converting to/from TIFF.

and it says to use image magick, I don't remember seeing anything for tiff, though that doesn't mean it isn't there

PhaZZed

11:48 pm on Aug 10, 2007 (gmt 0)

10+ Year Member



Hi jatar..

I don't need to display the image after the conversion, I have written a force download script, so the user would simply click a download button and the "save as" dialog would pop up.

Unfortunately, I am not able to use Image Magick :(

jatar_k

12:52 am on Aug 11, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



trouble is that there doesn't seem to be a method for saving as tiff

PhaZZed

11:10 am on Aug 13, 2007 (gmt 0)

10+ Year Member



ye, I see so, but the bmp isn't working.

When I convert to bmp and try open it using a number of programs, it returns 'invalid file format' the whole time :(

Little_G

1:06 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



Hi,

TIFF is a container format, the encoding of the image can be in different formats including JPEG. There probably isn't any need to convert to TIFF, BMP and JPEG should cover it.

Andrew

PhaZZed

1:16 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



I still cannot convert to .bmp either. I work for someone, and they require these formats, if it was a personal project, I would have moved on long ago.

You got any suggestions?

Little_G

1:21 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



Hi,

The 2wbmp functions are for converting to Wireless BMP format, which is for mobile phones and only supports black and white. GD doesn't support BMP, it may be possible to write something that can create BMP's it's a relatively simple file format.

Andrew

PhaZZed

1:24 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



I found phpThumb library, which looks like it's allowing me to convert from jpg to bmp, and seems to be working.

I guess I wil battle forwards, Thanks for the help Little_G!