Zubrag.com :: Forum

zubrag.com => Website Thumbnail Generator => Topic started by: mugwumpr on December 02, 2006, 02:07:55 AM



Title: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 02, 2006, 02:07:55 AM
I did all the downloading and unzipping and editing; I made sure that I had the syntax correct for generating a website thumbnail, but all I get is this error:

Thumbnail Generation Error. Thumbnail not created.

What have I done wrong?

 ???


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 02, 2006, 04:38:31 PM
Looks like your host does not allow to run Internet Explorer thus it cannot create website thumbnail.

Remove @ sign from the following line in the script, save, give it a try, and see if it outputs some errors.

 @exec('IECapt.exe ' . $website_url . ' ' . $cached_filename);


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 02, 2006, 10:30:57 PM
Hi zubrag,

It didn't generate any new errors; still just the thumbnail generation one.

I am my own host - running on a windows XP machine, php5, apache2..... Is there anything I can change in the settings to allow the script to run?


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 03, 2006, 06:03:16 AM
Its good you are at your own hosting. Things are easier to debug.

Seems like you have error output suppressed. Try adding following code after the first line in the webthumb.php. It will enable errors output to the browser.

Code:
ini_set('display_errors','1');
ini_set('error_reporting',E_ALL);

Make sure you also removed all @ signs from the file. This sign also suppresses error output.

Then try running web site thumnbnail creator again. Any new errors shown?

Check the folder you set as thumbnails folder ($thumbnails_folder setting). Does it contain any images?

Also post here parameters you are passing to the script. Maybe I'll be able to find something out from it.


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 04, 2006, 10:56:03 AM
I added those lines, removed the @, and unfortunately nothing changed.

No new error messages, no images in the thumbs folder, just the same old Thumbnail Generation Error.  I even double checked to make sure the thumbs folder is writeable; it is.

The line I'm using to try to generate something is:
http://www.mugwumpr.com/webthumbs/webthumb.php?url=http://www.petrodents.com
 


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 04, 2006, 01:36:13 PM
Strange, i tested it on Windows XP and it worked. Please make sure gdiplus.dll exists somewhere in your Windows folder. Try also copying gdiplus.dll to the folder where you saved iecapt.exe. Does it help?

If it does not, then please post here settings section from the script. I'll have a look...


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 04, 2006, 09:33:04 PM
A search shows that gdiplus.dll exists in 3 places in my windows folder, but I downloaded a fresh copy into the webthumbs folder anyway.  Still no joy.

 :-\

Here are my settings for the thing.  The **** is just to hide the entire path from public consumption; if you need it I can send it privately.

// Folder to save all thumbnails.
// Must end with slash!!!
$thumbnails_folder = 'C:/****/mugwumpr/webthumbs/thumbs/';

// thumbnails expiration time in minutes
$cache_expire_time = 60;

// quality (for jpeg only)
$image_quality = 100;

// resulting image type (1 = GIF, 2 = JPG, 3 = PNG)
$image_type = 3;

// maximum thumb side size
$max_x = 100;
$max_y = 100;

// If not equal 0 then cut original image size before resizing (in pixels).
// Long page will have bad thumbnail, its better to cut page length first.
$cut_x = 0;
$cut_y = 1024;

Just for giggles, I'm going to try installing it on my other machine at home in a couple of hours to see if it works there.  Maybe it will at least give a useful error message instead of being so dang shy about it.

 ;)


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 05, 2006, 03:07:05 AM
Lets try if iecapt.exe is working ok with simple web page layout.

Need to run iecapt in the following way. You can do that from command prompt (click Start Menu -> click Run option -> type cmd.exe -> then type string below).

c:\here\your\path\to\iecapt.exe http://www.goodsadvisor.com c:\test.png

It should create c:\test.png.  Does it work?


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 05, 2006, 11:26:45 AM
Whoo hoo!  It worked!  test.png exists!   :D


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 05, 2006, 11:43:24 AM
Very good. Now try replacing that simple layout site with one you had problems with.

c:\here\your\path\to\iecapt.exe http://www.petrodents.com c:\test.png

Is it also working?

Maybe you are running php in safe mode? Wondering if your php5 is allowed to perform "exec" php command.


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 06, 2006, 12:51:18 AM
Yup, that one worked, too.  Is the safe mode the register_globals thing?  I tried it set to both On and Off, restarting the server between changes, and I got the same old result both times.


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 06, 2006, 04:56:42 AM
Safe mode setting is named safe_mode in the php.ini

Please also check if you have some disable_functions directives in the php.ini. For example disable_functions exec

Lets try to get output from the iecapt.

Change following code
@exec('IECapt.exe ' . $website_url . ' ' . $cached_filename);

To
$arr = array();
exec('IECapt.exe ' . $website_url . ' ' . $cached_filename, $arr);
echo "<pre>"; print_r($arr);

and run script again. Does it show some information?


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 07, 2006, 02:24:59 AM
Heh.... ya, I guess naming safe mode safe_mode makes a lot of sense (sorry, it was late and I wasn't thinking clearly when I posted the last message).  It is now off, and it made no diff.  There are no disabled functions.

Changing the code produced the following result:
Array
(
   
  • => Usage: IECapt.exe http://www.example.org/ localfile.png
)
Thumbnail Generation Error. Thumbnail not created.



Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 07, 2006, 04:22:53 AM
That means parameters are broken or not passed to the iecapt.exe. Lets see what we pass to iecapt...

add following line before the exec('IECapt.exe ' ...) line:

echo '<b>IECapt.exe ' . $website_url . ' ' . $cached_filename . '</b>';

and run script again. It should print in bold how we run the capture. What is the output?


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 07, 2006, 02:12:21 PM
The message now is:

IECapt.exe http://www.petrodents.com C:/****/mugwumpr/webthumbs/thumbs/a925c804e448ab1597ad2007f559c49c.png
Array
(
   
  • => Usage: IECapt.exe http://www.example.org/ localfile.png
)
Thumbnail Generation Error. Thumbnail not created.

The **** part of the path from C: is correct.


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 07, 2006, 04:14:10 PM
Does that **** part contain special characters or spaces?


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 08, 2006, 01:45:45 AM
Yup, and the spaces were the problem.  When I move the thumbs directory directly under C: it works perfectly.  Thank you!

  :D  :-*


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 08, 2006, 04:22:04 AM
That was a bug in a script :-(   I fixed website thumb creator (http://www.zubrag.com/scripts/website-thumbnail-generator.php). Now it should work ok with spaces in the path. Thanks for all your help!


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 08, 2006, 12:42:59 PM
And thank you for your help and this script!  Using it has cut the load time on my links page to a tiny fraction of what it was when I was using public thumbnail sites (or it will when I finally get all 50+ links switched over).


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 13, 2006, 01:11:40 AM
I hate to tell you this, zubrag.....  I d/l your new version, and I'm back to getting the error again, even directly under C:.   :'(

I did the changes to the script that you suggested before, and here's the output:
IECapt.exe http://www.animalcameras.com C:/thumbs/5fe38d055b37c3bb79104a13a0cfe5b9.jpg
Array
(
)
Thumbnail Generation Error. Thumbnail not created.

It looks like there should be a picture in the folder, but there isn't, and it's giving me the Thumbnail Generation Error again.

Edit:  It will still pull up the existing thumbnails that are in the folder from before, it just won't create any new ones.  The folder is writeable.


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 13, 2006, 04:47:15 AM
It worked on my computer with parameters you specified.

Please make sure folder C:/thumbs exists, and $thumbnails_folder setting is set to 'C:/thumbs/' (note ending  slash, and single quotes. Double quotes may not work). 

Like this:
$thumbnails_folder = 'C:/thumbs/';
Does it help?


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 13, 2006, 04:22:30 PM
The folder exists (it has the thumbs from before in it, which webthumb.php will still display), it's writeable and the line to it matches your example exactly:
$thumbnails_folder = 'C:/thumbs/';

It was working directly under C: before even when it didn't like the spaces; now it doesn't work directly under C: either.

 ???


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: zubrag on December 14, 2006, 08:25:11 AM
Lets try changing
@exec('IECapt.exe ' . escapeshellarg($website_url) . ' ' . escapeshellarg($cached_filename));

to
exec('IECapt.exe ' . $website_url . ' ' . $cached_filename);

Maybe the fix I made for spaces is causing new problems (however it is working ok on my server).

If that does not help then please also try putting gdiplus.dll into the same folder with iecapt.exe.


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: mugwumpr on December 14, 2006, 03:42:59 PM
I went back and tried all the things you suggested from the beginning, step by step, and after playing with php.ini, it seems that the thing causing webthumb.php to choke is Safe_Mode being on, even though it seemed to have no effect before (and was actually On during the successful earlier tests ??? ).  I installed webthumbs on another machine and tried the same things there, and that's definitely what's at the root of it.

So, it's working again (w00t!) and I can stop bugging you and get on with switching all my files over.

Thanks again for your help and patience!  It's a great little script.

 :D


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: vash on August 28, 2008, 07:19:02 AM
I've been getting same problem... no errors displayed and no screen shot being displayed, I've noticed that this occurs only in .PNG and .GIF formats. It's quite a mystery since some people says that it works.

I made a very tiny tweak to instead redirect the page to the Image file URL instead of displaying the screenshot on the fly.

Code:
header("location: $website_url_md5.$output_format");
exit;

Place the code above after:
Code:
if (!file_exists($cached_filename)) {
  die("Thumbnail Generation Error. Thumbnail not created.");
}


Hope this help solve some old mystery lol ... cheers


Title: Re: Thumbnail Generation Error. Thumbnail not created.
Post by: moiseszaragoza on July 31, 2009, 11:02:28 AM
I am using PHP i see that my script want to use IECapt.exe i was wondering where would i get that file and where would i install it on the server?

Thanks