|
nogdog~6op6ou
|
 |
« on: November 16, 2009, 12:42:12 AM » |
|
I whipped up a PHP script for creating a grayscale 600x800 pixel JPEG image from any JPEG image file. (It may fail with really large images, so consider yourself warned.) http://charles-reace.com/kindle_ss.php http://charles-reace.com/kindle_screensaver.phpIt will resize and crop the image to be 600 x 800 pixels. In order to achieve that 3x4 aspect ratio, it lops off equal amounts from both sides if it's wider than that ratio, or else from top and bottom. Therefore if the important part of the image is not centered, you might not like the result. But hey, it's a quick and dirty method if you don't want to mess around with PhotoShop, The GIMP, or other image editing programs.  Enjoy. PS: The image you upload is not stored on the server, so you need not worry about any photos being re-used, sold, used as blackmail material, etc.
|
|
|
|
« Last Edit: November 16, 2009, 09:00:14 PM by NogDog »
|
Logged
|
|
|
|
|
911jason
|
 |
« Reply #1 on: November 16, 2009, 05:42:49 AM » |
|
How cool is that Nog, I'm sure many users will find this very helpful! =)
|
|
|
|
|
Logged
|
|
|
|
Betsy the Quilter
Woman in Charge
Global Moderator
Status: Shakespeare
   
Online
Gender: 
Alexandria, VA
Posts: 30799
I'm here to help. Really.
|
 |
« Reply #2 on: November 16, 2009, 09:17:57 AM » |
|
This is very cool. I've been playing with it, large files (2.3 MB, for one I tried) aren't recognized. But the smaller ones do well. I'm heading out but I'm eager to come back and play with it.
Betsy
|
|
|
|
|
Logged
|
"The future belongs to those who believe in the beauty of their dreams." -Eleanor Roosevelt "Until I feared I would lose it, I never loved to read. One does not love breathing." -Scout in To Kill a Mockingbird "Oh come on! Stake through the heart. A little sunlight. It's like falling off a log" -Buffy, the Vampire Slayer
|
|
|
|
scott_audio
|
 |
« Reply #3 on: November 16, 2009, 10:34:27 AM » |
|
Very cool indeed, eliminates the need to learn a graphics program and its fast
|
|
|
|
|
Logged
|
Seldom, very seldom, does complete truth belong to any human disclosure; seldom can it happen that something is not a little disguised, or a little mistaken. - Jane Austen
|
|
|
|
nogdog~6op6ou
|
 |
« Reply #4 on: November 16, 2009, 11:40:34 AM » |
|
I think there may be a bug in my resizing and/or cropping algorithm, as some images are coming up with blank areas on the bottom and/or right. I'll have to do some reviewing and testing tonight -- probably a stupid math error. I did find a somewhat better algorithm form converting the colors to gray scale, or at least it seems to give a bit more contrast.
|
|
|
|
|
Logged
|
|
|
|
Betsy the Quilter
Woman in Charge
Global Moderator
Status: Shakespeare
   
Online
Gender: 
Alexandria, VA
Posts: 30799
I'm here to help. Really.
|
 |
« Reply #5 on: November 16, 2009, 12:20:49 PM » |
|
The only image I tried that came out like that (so far) was less than 600x800. I'll let you know if I find any more. Can you do one that does the same for DX images? (Not meaning to be greedy--this is great!)
Betsy
|
|
|
|
|
Logged
|
"The future belongs to those who believe in the beauty of their dreams." -Eleanor Roosevelt "Until I feared I would lose it, I never loved to read. One does not love breathing." -Scout in To Kill a Mockingbird "Oh come on! Stake through the heart. A little sunlight. It's like falling off a log" -Buffy, the Vampire Slayer
|
|
|
|
nogdog~6op6ou
|
 |
« Reply #6 on: November 16, 2009, 01:07:49 PM » |
|
The only image I tried that came out like that (so far) was less than 600x800. I'll let you know if I find any more. Yeah, that's pretty much what I think I was seeing, which makes me wonder if the inverse is true on larger images causing it to crop too much. Can you do one that does the same for DX images? (Not meaning to be greedy--this is great!)
Betsy
Should be fairly simple for the DX version: I'll just add a radio button pair on the form to select the desired size, then change the base width/height values based on that selection.
|
|
|
|
|
Logged
|
|
|
|
|
nogdog~6op6ou
|
 |
« Reply #7 on: November 16, 2009, 05:06:01 PM » |
|
I think I got the scaling/cropping issue fixed, so now it's off to DX support....
|
|
|
|
|
Logged
|
|
|
|
|
Jaasy
|
 |
« Reply #8 on: November 16, 2009, 05:17:50 PM » |
|
Very nice
|
|
|
|
|
Logged
|
|
|
|
|
nogdog~6op6ou
|
 |
« Reply #9 on: November 16, 2009, 05:29:13 PM » |
|
DX option added. 
|
|
|
|
|
Logged
|
|
|
|
|
nogdog~6op6ou
|
 |
« Reply #10 on: November 16, 2009, 08:50:16 PM » |
|
I changed the link to http://charles-reace.com/kindle_screensaver.php, but the original link will automatically redirect to the new one. Also added some navigation links and a couple adverts (you never know). I'll be leaving it alone now unless anyone finds any bugs that need extermination.
|
|
|
|
|
Logged
|
|
|
|
Pea
Status: Dr. Seuss
Offline
Gender: 
Maui Hawaii
Posts: 37
|
 |
« Reply #11 on: November 16, 2009, 09:54:32 PM » |
|
You are fabulous! Thanks so very much
|
|
|
|
|
Logged
|
|
|
|
|
mlewis78
|
 |
« Reply #12 on: November 16, 2009, 10:35:50 PM » |
|
I haven't managed to get an image yet. Is there a maximum file size or dimensions of the file for this to work? I was trying it with the K2 size screensaver.
Thanks for putting this up, Nog Dog.
|
|
|
|
|
Logged
|

New York, NY Flutist, Legal Services Professional Readers: K4, K3, Kindle DX (US), Sony PRS-350, B&N Nook STR and Bookeen Cybook Opus
|
|
|
|
nogdog~6op6ou
|
 |
« Reply #13 on: November 17, 2009, 12:02:11 AM » |
|
It should probably reject any file over 2MB. There could also be a potential with memory maxing out for large images in terms of pixel width/height, due to the way the PHP image functions work. I tried a 1000x800 image file that was about 1.5MB in size and it worked OK, though it probably took about 45 seconds or so before the download pop-up appeared.
I'll have to check the host settings tomorrow to see what my max memory size is, and I may then need to add some validation on the uploaded image's dimensions to prevent out-of-memory errors, which can be difficult to trap in a user-friendly manner.
|
|
|
|
|
Logged
|
|
|
|
|
nogdog~6op6ou
|
 |
« Reply #14 on: November 17, 2009, 08:32:18 PM » |
|
Added some validation to reject any uploaded image with more than 3,000,000 pixels (e.g. a 2000 X 1500 pixel image) in order to avoid using too much memory on the server. Also tweaked the user interface a bit including some more useful error messages.
|
|
|
|
|
Logged
|
|
|
|
|
mlewis78
|
 |
« Reply #15 on: November 17, 2009, 08:42:58 PM » |
|
Thanks. Now I know that my images were too big, since it tells me so.
|
|
|
|
|
Logged
|

New York, NY Flutist, Legal Services Professional Readers: K4, K3, Kindle DX (US), Sony PRS-350, B&N Nook STR and Bookeen Cybook Opus
|
|
|
|
|
|
BTackitt
|
 |
« Reply #17 on: December 27, 2009, 05:54:36 PM » |
|
giving this thread a bump so our new members can find it easily and make their own Screensavers if they wish. although I and others will still happily help if asked.
|
|
|
|
|
Logged
|
|
|
|
|
|
Gwennie
Status: Jane Austen
 
Offline
Gender: 
Sunny So. CA
Posts: 371
|
 |
« Reply #19 on: June 17, 2010, 08:29:27 AM » |
|
bumpage because this is so great. I find with really large files, I go into Photoshop Elements and change them to gray scale, and maybe auto-sharpen too, and that usually gets their size down. Thanks for this! 
|
|
|
|
|
Logged
|
|
|
|
|
|
|