Zubrag.com :: Forum

zubrag.com => Website Thumbnail Generator => Topic started by: puglover on June 25, 2007, 01:14:35 AM



Title: Fixed width & height
Post by: puglover on June 25, 2007, 01:14:35 AM
Hello there, great script, thank you for sharing this,

Do you know by any chance how to set a fixed width & height of the screenshots ? If the website has a very small amount of content in the top of the page and nothing below, the screenshot is cut and has no more a squared shape but a rectangular one (same thing is the height of the website content is very long). I'd like to have all my screenshots with the same format, independently of the website's content, is that possible ? any clue of how to do it ?! Thank you very much, Frank


Title: Re: Fixed width & height
Post by: zubrag on June 25, 2007, 08:44:00 AM
Hi. There are following options in the thumb.php

// 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;

Are those of any help?


Title: Re: Fixed width & height
Post by: puglover on June 25, 2007, 01:05:35 PM
Hello! thank you or answering quickly  ;D

Well I've seend this parameters but it's working only for long pages, not for short ones aren't they ? I can cut the page, but i' cant actually have a specific format if the page is very short or am I mistaken ? Let say i need all my shots to have the format 240x180, even if the pages are long or short, how can i do that please ?

Best regards


Title: Re: Fixed width & height
Post by: zubrag on June 26, 2007, 06:43:15 AM
You could achieve such effect by putting website thumbnail into the div block.

<div style="width:240; height:180; background:#FFFFFF">
  <img src="http://example.com/webthumb.php?....." />
</div>


Title: Re: Fixed width & height
Post by: puglover on June 26, 2007, 07:01:51 PM
Hi there, yes i know what you mean, thanks, but it the website's background is different than white this will be kind of odd...


Title: Re: Fixed width & height
Post by: zubrag on June 27, 2007, 09:41:13 AM
I see, but script currently cannot determine site's background. Not even sure how to implement this feature. It has to be really smart.

I'm thinking of following: get color of the thumb's top left pixel, and use the color as background color.

Not sure if that would work. Please provide your comments based on website thumbnails you have generated.


Title: Re: Fixed width & height
Post by: puglover on June 27, 2007, 12:56:04 PM
Hi Zubrag,

Yes it should not be easy to code it...it implies the creation of a canvas width fixed height & width

Tricky question about how to do it, if you get the top left pixel color, you may pick the color of the navigation menu, not the page background color, id rather pick the bottom page color don't u think ?

What i don't get is why iecapt is not able to take a regular screenshot of the page with the parameters we want, in that case fixed height & width ? What's the problem here ? Is the program making a screenshot from the HTML code of the website instead of making a "real" screenshot of what actually appears on screen ??


Bests


Title: Re: Fixed width & height
Post by: zubrag on June 29, 2007, 03:17:31 PM
As far as i know IECapt does not accept "size control" parameters. It somehow grabs whole page rather than just visible area. That is why we are having problems.

Do you suggest to parse html/css text to find out the background color? Nice idea! But this will take a little longer to render thumbnail because we'll need to to load html and css from the remote server and parse it. Will add option to turn this feature on/off.