You are here: Re: Resampling an Image « All PHP « IT news, forums, messages
Re: Resampling an Image

Posted by Dennis de Wit on 07/24/06 09:53

dimo414 wrote:
> I have the following script to take an image in the 'img' directory,
> and create a thumbnail version in the 'thumb' directory.
>
> $image =
> imagecreatefrompng('../galleries/'.$gallery.'/img/'.$fileid.'.'.$type);
> $image_p = imagecreatetruecolor($width, $height);
> imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height,
> $width_orig, $height_orig);
> imagepng($image_p,
> '../galleries/'.$gallery.'/thumb/'.$fileid.'.'.$type);
>
> The image file was previously saved sucessfully as $fileid.'.'.$type,
> all the widths/heights are previously defined, as is $gallery. There
> is no eror message output when the script concludes, and yet the image
> has not been created in 'thumb'; or anywhere else, as far as I can
> tell.
>
> It's some kind of logic issue, but I just can't figure it out.
>

Do you have error reporting on? Use error_reporting(E_ALL); to see all
errors that can occur here. Also check whether or not your php
installation has access to the thumb directory.

Check whether it would give an error message when you change the path
(change thumb into thumbiethumb, or something smaller :-D) Perhaps it's
indeed placing the file somewhere different from where you would expect
it to be placed

Dennis

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация