PDA

View Full Version : Crop Thumbnails


pixelpunk
10-23-2004, 10:11 AM
This mod will create cropped thumbnails that exactly matches the width and height set in the admin panel (the original function uses those as max values, either one).

Good if you like your thumbs to have an exact width and height, whatever size the original image has.

Download from the front page -> extras.

// punK

will only work with version 1.2, not previous versions.

blinking8s
10-23-2004, 10:37 AM
humm...ok, its on there, but it only worked for a few of my photos...

http://www.blinking8s.com/blog/index.php?x=calarchive

im diggin it though, once I get this fixed...hehe

pixelpunk
10-23-2004, 10:43 AM
something must be wrong.

I'll check it further.

// punk

blinking8s
10-23-2004, 10:44 AM
when i go to regenerate thmbnails (it does this with or without the cropped thumbnail addon)


Warning: imagejpeg(): Unable to open '../thumbnails/thumb_IMG_0061.jpg' for writing in /home/blinks/public_html/blog/admin/index.php on line 883

Warning: chmod(): Operation not permitted in /home/blinks/public_html/blog/admin/index.php on line 885

Warning: imagejpeg(): Unable to open '../thumbnails/thumb_IMG_0161.jpg' for writing in /home/blinks/public_html/blog/admin/index.php on line 883

Warning: chmod(): Operation not permitted in /home/blinks/public_html/blog/admin/index.php on line 885

Warning: imagejpeg(): Unable to open '../thumbnails/thumb_IMG_0967.jpg' for writing in /home/blinks/public_html/blog/admin/index.php on line 883

Warning: chmod(): Operation not permitted in /home/blinks/public_html/blog/admin/index.php on line 885

Warning: imagejpeg(): Unable to open '../thumbnails/thumb_rocks.jpg' for writing in /home/blinks/public_html/blog/admin/index.php on line 883

Warning: chmod(): Operation not permitted in /home/blinks/public_html/blog/admin/index.php on line 885

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/blinks/public_html/blog/admin/index.php on line 883

Warning: chmod(): No such file or directory in /home/blinks/public_html/blog/admin/index.php on line 885


any clue?

pixelpunk
10-23-2004, 10:53 AM
Your thumbnails folder is chmod 777 I guess?

Very strange it behaves like that.

// punk

pixelpunk
10-23-2004, 10:58 AM
I inserted 57 images, all different sizes and types. Every single thumbnail generated is 100x100 pixels (my settings).

I need more info about your stuff in order to do any educated guesses... :/
Your error is weird to and might have something to do with it all.

// punK

blinking8s
10-23-2004, 11:02 AM
nothing out of the serious norm...

i deleted all the thumbs in the ftp, then regenerated them...all sizes are fine...but still errors, only 2 though

knocked it down to


Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/blinks/public_html/blog/admin/index.php on line 883

Warning: chmod(): No such file or directory in /home/blinks/public_html/blog/admin/index.php on line 885

but i have 7 images posted, it says its creating 8 thumbnails...

tell me the info you need and Ill dig it up, nothing really out of the ordinary though...Im confused...haha

imagejpeg($img, "../thumbnails/thumb_$file",$cfgrow['compression']);
$thumbimage = "../thumbnails/thumb_$file";
chmod($thumbimage,0644);

lines 883-885

pixelpunk
10-23-2004, 11:10 AM
It's probably some file that you can't see.
The fault above is regarding one image only, it generates two different errors.
First because its not a valid file (jpg, gif, png) second it can't find the file which is obvious since it wasn't created due to not being a valid file.

Look for hidden files in your images directory, some hidden file or just another file should be there. Or just an index.html file you created so people can't browse the directory.

Only image files should be there, if you need another file in there you can have it and ignore the errors produced.
// punk

blinking8s
10-23-2004, 11:11 AM
this is when you love ms windows, i backed everything up when playing with the script last night, well imessed up a file and just reuploaded th elast backup, but windows inserted a thumb.db file into the image dir and yeah...not cool

haha...

you script works great!

sorry about all that, you can delete the threads if you want...

*edit* we posted at the same time...you hit the nail on the head!

pixelpunk
10-23-2004, 11:11 AM
Your thumbnails are good now, right?
Every one looks good anyway.

// punk

blinking8s
10-23-2004, 11:12 AM
yeah, its working fine now...thanks

turnover
10-25-2004, 09:33 PM
nice addon punk !! very good ;)

abel
01-26-2005, 06:14 PM
will this work on v1.3??

thanks...