View Full Version : Resizing images other than jpg
04-01-2007, 05:21 PM
Can it be done?
I currently use a script which allows me to remaster a jpg image and resize it to what ever i feel like but i was wondering if i could do the same for other image types.
I need to basicly create a thumbnail to all uploaded images...a better method in this case may be to convert the other image types into jpgs? If thats possible... Or do something similar to printscreening the image and saving that?
Just ideas i have, i need some advice and tips here...
04-01-2007, 07:29 PM
What are the other image types?
.png is fully supported by PHP GD Libraries.
.gif possibly (I'm not sure of limitations).
04-01-2007, 07:34 PM
ah ok, i didnt realise about .png... Gif isnt supported and neither is Bmp.
Is there anyway of working around this. I dont encourage the use of Bmp images its just i know some people are thick and try and upload them!
04-01-2007, 08:33 PM
I believe that PHP handles gif's, jpeg's and png's. So you would have to create a script that only allows those three image types and will prompt the user to to convert the image if the try and upload a bmp.
04-01-2007, 09:19 PM
You can use imagemagik to do bmp's. Its an addon to php like gd is.
04-01-2007, 11:55 PM
thanks for that, my web host says they wont support imagemagick or magickwand(for php) :( is there any other possible way around this? Could i open an image like if i were to create one using text etc and add in a background of the bmp, resave it and then resize it or anything? I'll have a go at knocking it up if anyone says its feasible.
04-01-2007, 11:58 PM
Bah your not looking for support just an install :p. I don't think there is any other way to handle bmp's. Just have it error out when they try to upload it and tell them I only accept jpg, jpeg, gif, png!
04-02-2007, 02:11 PM
Perl supports Imagemagick too. That would be what most
people call CGI scripting. Perl scripting resides in the cgi-bin directory.
But before you dig in too deeply ... what is the actual purpose of
what you're doing? Perhaps if we know more about your project, we
might have a different way to accomplish it.
04-02-2007, 04:00 PM
You can find a couple of free third party functions at JPEXS.com (http://www.jpexs.com/eng/default/php.html) which gives you the ability to work with BMPs. The bmp.php file you can download from their website has imagebmp() (create new BMP file) and imagecreatefrombmp() (does the same thing as imagecreatefromjpg only with a bmp).
04-03-2007, 10:14 PM
Thanks for all the help. My project is to create an image uplod form on a page which also creates a thumbnail of the image. Its simple if the images are only jpgs but i have been asked to try and help people who dont know very much about images and try and upload bmp files. This is pureley for the users convenience but also for download times and webspace etc...
Im gonna have a go at trying imagemagick again with my host, i only got through to an online service centre so i'll open a ticket with people who i think may know more about what they are talking about.
I have tried to mess around with perl and cgi before but it never really worked for me (trying to include a progress bar for the uploads) and so im not really eager to have a punt at using it as i'll probably be knocking up the right code but executing it wrong etc.
04-03-2007, 10:31 PM
You can take a look at this for a cool effect, I have never used so I have no opinion on it.
For my image upload I use this: http://phpthumb.sourceforge.net/
It does everything. AND I think if you dont have imagemagik installed, it uses other methods for bmp. AND it does animated GIF's, but I "think" you need imagemagik for animation Im not sure.
I hope that helps ya :)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.