Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Oct 2005
    Location
    Surrey, England
    Posts
    286
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Resizing images other than jpg

    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...

    Thanks
    Daniel Warner
    - - - - - - - - - -
    GuitarMart.co.uk - Free Online Classified Advertisement for Guitarists in the United Kingdom. Free Ads with a Free Photo.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    What are the other image types?

    .png is fully supported by PHP GD Libraries.
    .gif possibly (I'm not sure of limitations).

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Location
    Surrey, England
    Posts
    286
    Thanks
    2
    Thanked 2 Times in 2 Posts
    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!
    Daniel Warner
    - - - - - - - - - -
    GuitarMart.co.uk - Free Online Classified Advertisement for Guitarists in the United Kingdom. Free Ads with a Free Photo.

  • #4
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    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.
    Leonard Whistler

  • #5
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You can use imagemagik to do bmp's. Its an addon to php like gd is.

  • #6
    Regular Coder
    Join Date
    Oct 2005
    Location
    Surrey, England
    Posts
    286
    Thanks
    2
    Thanked 2 Times in 2 Posts
    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.
    Daniel Warner
    - - - - - - - - - -
    GuitarMart.co.uk - Free Online Classified Advertisement for Guitarists in the United Kingdom. Free Ads with a Free Photo.

  • #7
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Bah your not looking for support just an install . 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!

  • #8
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Daniel ...

    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.

  • #9
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You can find a couple of free third party functions at JPEXS.com 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).

  • #10
    Regular Coder
    Join Date
    Oct 2005
    Location
    Surrey, England
    Posts
    286
    Thanks
    2
    Thanked 2 Times in 2 Posts
    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.
    Daniel Warner
    - - - - - - - - - -
    GuitarMart.co.uk - Free Online Classified Advertisement for Guitarists in the United Kingdom. Free Ads with a Free Photo.

  • #11
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You can take a look at this for a cool effect, I have never used so I have no opinion on it.

    http://www.phpclasses.org/blog/post/...4-at-last.html

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •