Thumbnail generator

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Thumbnail generator

Post by suhasiniketha »

Hi
Please help me

I'm unable to create Thumnail for Images greater than 1.3 MB
with dimensions 1990px width and 2200px height

please help me anyone.....................please
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Thumbnail generator

Post by Benjamin »

What is the memory limit set at in php.ini?
suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Re: Thumbnail generator

Post by suhasiniketha »

it's showing 12M
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Thumbnail generator

Post by Benjamin »

For the page processing thumbnails, you'll more than likely need to increase it to 50MB or more. You can check your error log to verify that the script was hitting the 12MB memory limit. Remember that jpg images are compressed. When decompressed they can take up to 10 times more memory.

You can increase the limit on a per page basis by using ini_set();
suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Re: Thumbnail generator

Post by suhasiniketha »

Ok Thank you

where we have to place this ini_set();.

In page where we are showing thumbnails?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Thumbnail generator

Post by Benjamin »

Yes, have a look at the manual for usage: http://us2.php.net/manual/en/function.ini-set.php
suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Re: Thumbnail generator

Post by suhasiniketha »

Thank you....
now I have to set memory limit?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Thumbnail generator

Post by Benjamin »

Yes, that is correct.
suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Re: Thumbnail generator

Post by suhasiniketha »

Its not working.
Still Im notable to see thumbnail
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Thumbnail generator

Post by Benjamin »

What are the errors? Have you checked your error log? Enabled error reporting and display errors?
suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Re: Thumbnail generator

Post by suhasiniketha »

I didnt get any error log
where to find this?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Thumbnail generator

Post by Benjamin »

/var/log/httpd/error_log or /var/log/apache/error_log or /var/log/error_log

You might be able to view it via CPanel as well.

Best bet is to turn on error reporting:

Code: Select all

 
error_reporting(E_ALL);
ini_set("display_errors", 1);
 
suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Re: Thumbnail generator

Post by suhasiniketha »

ok
but it didnt displayed any result
suhasiniketha
Forum Newbie
Posts: 20
Joined: Wed Feb 04, 2009 10:20 pm

Re: Thumbnail generator

Post by suhasiniketha »

shall i send code ?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Thumbnail generator

Post by Benjamin »

You put the code I posted at the top of the file and no errors were displayed? Yes, please post your code.
Post Reply