You might want to check you aouto thumb height and width in the gallery config.php
If your images are different sizes change either ther height or width and leave the other blank. All my images are almost exactly the same size so I really have not had this problem.
Hope it helps
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-02-20
It's just a matter of replacing the 'imagecreate' function calls with 'imagecreatetruecolor'. That will fix the low quality of resized images.
php.net itself writes the following about this issue:
"There is a problem due to palette image limitations (255+1 colors). Resampling or filtering an image commonly needs more colors than 255, a kind of approximation is used to calculate the new resampled pixel and its color. With a palette image we try to allocate a new color, if that failed, we choose the closest (in theory) computed color.
This is not always the closest visual color. That may produce a weird result, like blank (or visually blank) images. To skip this problem, please use a truecolor image as a destination image, such as one created by imagecreatetruecolor()."
It works!
Gerrit.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My host has upgraded to GDLib 2.0 also. I have 3 sites on this host and none will auto thumbnail anymore. I am running phpws 8.3, gallery mod 1.3 on a UNIX host.
I have tried replacing the words 'ImageCreate' with 'imagecreatetruecolor' in /mod/gallery/index.php but I just keep getting the same error. Perhaps I did'nt understand the above suggestions fix process. Is that what was meant by "replacing the 'imagecreate' function calls with 'imagecreatetruecolor'"???
Has anybody actually managed to fix this error? has anybody got their code working with the same environment specs as me? if so I'd love to use your code. I can easily create my own thumbnails in photoshop however my users are technophobic.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Gerrit,
thanks for contacting me regarding this issue. You mentioned in your email that a global replace would have altered not only the imagecreate calls but also the functional stuff where imagecreate appears in the code. Sure enough this was the problem. Thanks for sending me through your code examples. Ihave installed them and am now back up and running successfully. (I just had to alter my language file a little by appending gal_ to the tran string.) Awesome! Thanks again Gerrit.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-04-10
Hi,
The main change I made is in index.php by replacing:
$ThumImg = ImageCreate ($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight);
with the following clause:
$ThumImg = @ImageCreateTrueColor($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight);
if (!$ThumImg) $ThumImg = ImageCreate($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight); }
This will ensure that if ImageCreateTrueColor is not in your PHP version, the
old ImageCreate will be used.
I also replaced all @copy calls with @move_uploaded_file
It's a safer and better alternative for uploading files in PHP.
Good luck,
Gerrit.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-04-10
Sorry,
small mistake in the clause: should be
$ThumImg = @ImageCreateTrueColor($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight);
if (!$ThumImg) {$ThumImg = ImageCreate($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight); }
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I use the auto thumbnail the image quality gets shot down.
My host just updated to GD Lib 2.0
Any suggestions or solutions????
You might want to check you aouto thumb height and width in the gallery config.php
If your images are different sizes change either ther height or width and leave the other blank. All my images are almost exactly the same size so I really have not had this problem.
Hope it helps
mind posting the code ???
It's just a matter of replacing the 'imagecreate' function calls with 'imagecreatetruecolor'. That will fix the low quality of resized images.
php.net itself writes the following about this issue:
"There is a problem due to palette image limitations (255+1 colors). Resampling or filtering an image commonly needs more colors than 255, a kind of approximation is used to calculate the new resampled pixel and its color. With a palette image we try to allocate a new color, if that failed, we choose the closest (in theory) computed color.
This is not always the closest visual color. That may produce a weird result, like blank (or visually blank) images. To skip this problem, please use a truecolor image as a destination image, such as one created by imagecreatetruecolor()."
It works!
Gerrit.
My host has upgraded to GDLib 2.0 also. I have 3 sites on this host and none will auto thumbnail anymore. I am running phpws 8.3, gallery mod 1.3 on a UNIX host.
I have tried replacing the words 'ImageCreate' with 'imagecreatetruecolor' in /mod/gallery/index.php but I just keep getting the same error. Perhaps I did'nt understand the above suggestions fix process. Is that what was meant by "replacing the 'imagecreate' function calls with 'imagecreatetruecolor'"???
Has anybody actually managed to fix this error? has anybody got their code working with the same environment specs as me? if so I'd love to use your code. I can easily create my own thumbnails in photoshop however my users are technophobic.
Gerrit,
thanks for contacting me regarding this issue. You mentioned in your email that a global replace would have altered not only the imagecreate calls but also the functional stuff where imagecreate appears in the code. Sure enough this was the problem. Thanks for sending me through your code examples. Ihave installed them and am now back up and running successfully. (I just had to alter my language file a little by appending gal_ to the tran string.) Awesome! Thanks again Gerrit.
Hi,
The main change I made is in index.php by replacing:
$ThumImg = ImageCreate ($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight);
with the following clause:
$ThumImg = @ImageCreateTrueColor($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight);
if (!$ThumImg) $ThumImg = ImageCreate($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight); }
This will ensure that if ImageCreateTrueColor is not in your PHP version, the
old ImageCreate will be used.
I also replaced all @copy calls with @move_uploaded_file
It's a safer and better alternative for uploading files in PHP.
Good luck,
Gerrit.
Sorry,
small mistake in the clause: should be
$ThumImg = @ImageCreateTrueColor($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight);
if (!$ThumImg) {$ThumImg = ImageCreate($gal_auto_thumbnail_newwidth, $gal_auto_thumbnail_newheight); }
I guess I have 2.0.12 compatible according to the phpinfo I ran on the server.
I tried the fix above, but the thumbs are still muddy, almost like a weird negative. Is there something I'm still missing?