php & gd



Hi all

I seem to be having crainum gas and need some assistance.

PHP 5.0.5,
gd 2.0.33-2 ( rpm ),

In manipulating images, I allow authenticated users access to upload
images for later viewing. If you upload a 640x480, php creates a
thumbnail automatically ( 128x92 ) and saves in a suitable spot.

Now here is the problem: If before I upload an image I decide since it
was shot landscape and I rotate it 90 degrees then save it, when the
thumbnail is viewed on the web site, you see elongated image material.
If you view the image ( not the thumbnail ) everything is OkieDokie.

Thumbnail : http://www.wishingwellfarm.com/SearchPix.php?GoatID=10
click on the image to see the big version. This is a cropped image...

If you remember correctly, if an image is wider than tall, it is
considered 'landscape'. Ok, so I suppose that you *could* landscape
anything, but in this case:

if ( ( $width/$height) >= 1 ) {
# We are landscape, so image is ... normal
$ThumbWidth = 128;
$ThumbHeight = 92;
} else {
# We are portrait, make it taller than wider.
$ThumbWidth = 92;
$ThumbHeight = 128;
};

I guess that I am asking how to tell the difference between a rotated
original and a original original?

thanks

todh

.



Relevant Pages

  • Re: [PHP] Creating thumbnails using Image Functions, then saving to folders
    ... PS You probably CAN set up FTP access and use PHP FTP to shuffle files ... I am looking to create a thumbnail from an uploaded image, ... folder chmod'd world read/writable for the process to work. ...
    (php.general)
  • Re: thumbnails
    ... I want that it's generated by php. ... If you want to create thumbnails from big pictures, take a look at the following ... * imagecreatefromjpeg(), imagecreatefromgif, etc. - loads an image to memory ... You can use these to automatically create thumbnail image files. ...
    (alt.php)
  • Re: [PHP] Creating thumbnails
    ... Subject: [PHP] Creating thumbnails ... Did you even try to Google "PHP automated thumbnail" ... If you want to have the hi-res image unavailable, ... Google for "PHP authenticate user" should do the trick on that. ...
    (php.general)
  • Re: opening a directory
    ... // Get the original geometry and calculate scales ... // Check whether the actual image is a thumbnail ... $isThumb = false; ... <?php displayPhotos(); ?> ...
    (comp.lang.php)
  • Re: Brain dead... write image to file
    ... function resize(){global $blob_arr; ... <?php} ?> ... $origStream = imagecreatefromstring; ... // calculate thumbnail size, retaining aspect ratio ...
    (php.general)