dont keep Original Picture
Zim
Joined: 2003-09-13
Posts: 8 |
![]() |
I also have the need to NOT keep the original pics... my thoughts, algorithmically, were - upload original picture I'm new to PHP, but then again, 5 years ago I was new to Perl, and now I'm writing 2000+ line scripts in that, so I guess it'll be a learning experience. Then again (worst case from an integration point of view), it could be a php system call out to a Perl script that does the cleanup after each pic is processed inside Gallery. OR... - upload original pic Still if you see an fundamental flaw in my approach, please let me know. Thanks, |
|
loxly
Joined: 2003-01-28
Posts: 126 |
![]() |
beckett wrote:
I have no idea. Wanna be my guinea pig and test it out?? I'm willing to be a guinea pig and test it with 1.4.1 if someone can email me the code and instructions Debbie dc@loxly.com |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
Well, my resize script is at http://www.beckettmw.com/testgallery/ , and I've since tested and it works with all current versions of Gallery just fine still. However, my script works for resizing photos *after* they've been uploaded. If you want to resize *on upload*, either read this thread, and apply killerblade's patch (and optionally the EXIF code I mentioned afterwards) to util.php, *or*, you can wait for v1.4.1 which will implement roughly the same thing as killerblade's code. -Beckett ( beck@beckettmw.com) |
|
loxly
Joined: 2003-01-28
Posts: 126 |
![]() |
I can wait |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
[Gallery Remote] Yes... except rather this code goes in "after" Gallery Remote. Gallery Remote, like a regular user, will submit arbitrarily-sized photos, which will then be "forced" down either to a maximum dimension, maximum filesize, or both. I *just* this second mentioned your question to Pierre, the Gallery Remote developer, so he's aware of it, and one way or another GR will work. ;) -Beckett ( beck@beckettmw.com) |
|
loxly
Joined: 2003-01-28
Posts: 126 |
![]() |
Cool, sounds perfect. I have about 10,000 photos to upload, so I want to make it as efficient as possible. Debbie |
|
moritz69
Joined: 2003-07-30
Posts: 8 |
![]() |
thanks again killerblade for your hack! so beckett spoke with the GR developer. but when will there be a new version of GR with this cool hack implemented? greetings |
|
loxly
Joined: 2003-01-28
Posts: 126 |
![]() |
Patience is a virtue |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
Hunh? My point was that, properly implemented, GR will work just fine with the killerblade hack. I was just stating that currently, GR only resizes *optionally* and doesn't yet support resizing on the GR end by reading the "force resizing" option (which hasn't been implemented yet). -Beckett ( beck@beckettmw.com) |
|
moritz69
Joined: 2003-07-30
Posts: 8 |
![]() |
ok sorry, then i understood something wrong... |
|
tomsawyer123
![]()
Joined: 2002-07-24
Posts: 81 |
![]() |
killerblade wrote:
hi folks! Your hack seem to be great but i didn't find the line above! In which file sould I finf it? Tomsawyer |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
::moritz69:: Hrm. It's possible it's not working right w/GR. I'm adding what's essentially killerblade's code to v1.4.1 and we'll make sure that it works with GR for that. As for FTP, it just means you can upload your photos *anywhere* to your webserver, then provide the full path to that directory. The "FTP" is just used to transfer the files to your webserver. But you can get them there whatever way you like. ::tomsawyer123:: The code has moved since killerblade's original post. No longer in save_photos.php it's now in the processNewImage() function in util.php. -Beckett |
|
tomsawyer123
![]()
Joined: 2002-07-24
Posts: 81 |
![]() |
tks for your help. I manage to add the code. cu tom |
|
porkozone
Joined: 2003-09-25
Posts: 11 |
![]() |
Any idea on how soon v1.4.1 will be released? No rush, mind you... I just don't see a need to add this code in if it's going to be "officially" done too soon. I am just now setting up my gallery, so am wondering if I should just hang tight and wait until 1.4.1 to start uploading photos... While I'm inquiring, is there a tenative date for the release of G2? Again, no rush, just trying to figure out how soon to start building my family photo gallery! |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
1.4.1 Soon-ish, but my guess would be within a month. G2 There's no official schedule for G2. We're making *incredible* progress, but we're not going to give any hints at a date quite yet. My advice is not to depend on G2 anytime very soon, but anything could happen. ;) -Beckett ( beck@beckettmw.com) |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
OKAY!! (big grin on my face) Auto-resize on upload is now available as of Gallery v1.4.1-cvs-b112. So read up FAQ A.2, and give it a shot, if you don't want to wait for the 1.4.1 release. The changed code is loosely based on the original code from killerblade. This code will *not* affect images that are already in your gallery, so if you still need to resize images after the fact, you'll have to either grab my myresize code, or wait a bit longer. I'm planning on adding support to resize originals in the [resize] button for each album. -Beckett ( beck@beckettmw.com) |
|
Grinch
Joined: 2002-08-28
Posts: 24 |
![]() |
This is a great little piece of code, but it doesn't do one important thing. If the picture being resized is already the correct size to begin with, it should still adjust the photo quality to match the configuration settings. For example: Original photo: 640x480 = 240kb Right now it just leaves the original file as is. Would this be possible to add in? |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
Actually, it does do that. Or if not, please post the output of the image add with debug mode on. (I tested this about 100 times this week, so I'm 95% sure this should be working). Remember, right now this code only affects new images that you upload. Also, the filesize compression only applies to JPEG and PNG images. At some point, I'll add "resize original" features to the [resize] button so that existing original images can be resized. -Beckett ( beck@beckettmw.com) |
|
Grinch
Joined: 2002-08-28
Posts: 24 |
![]() |
Thanks for the quick reply. I'm using version 1.3.4-pl1. Does that change anything? How do I turn debug mod on? |
|
BorgKing
![]()
Joined: 2002-09-12
Posts: 314 |
![]() |
beckett was talking about Gallery v1.4.1-cvs-b112. |
|
Grinch
Joined: 2002-08-28
Posts: 24 |
![]() |
Well I am stuck using 1.3.4-pl1 because I'm using the Snail Source phpBB integration mod. I heard that Gallery will soon offer integration with phpbb, so I guess I'm going to have to wait. |
|
PressureDrop
Joined: 2003-10-07
Posts: 6 |
![]() |
The MyResize code is a lifesaver =) I have 'unmetered' HD and Bandwidth on my server but I have a soft limit of 125 megs, this took me from 170megs down to 105megs (I still kept the originals pretty large) anyways I cant wait for a phpbb integrated gallery with the resize on upload and ditch original all built in to start with -Zac- |
|
latzke
Joined: 2003-09-30
Posts: 6 |
![]() |
Beckett, this is some great stuff, thanks a ton for the feature. I do, however, have a question after reading this post... beckett wrote:
If you download my myresize code (mentioned above), then enter an absurdly large number into the max. size box (say, 20000 pixels), and put the same number (or higher) into the ".sized" size box, then it will go through and remove all of the .sized images without touching your originals. Say I've downsized all the "original" pictures to 800x600 using your code, but later want to go back to having 2048x1536 "originals." ... Would I be able to do that by FTPing the full-sized pictures, with the exact same names, into the appropriate album folder, then doing what you describe in your quote? I guess I'm just wondering if your resize program will take a look at the original photo, realize it is larger than Gallery thinks the original photo is (cause I've replaced it), and have this result in pages that account for the increase in size of the "original" photo? (Yes, I know I could just re-add the album and delete it, but that would kill descriptions, captions, etc). Thanks, |
|
latzke
Joined: 2003-09-30
Posts: 6 |
![]() |
latzke wrote:
I guess I'm just wondering if your resize program will take a look at the original photo, realize it is larger than Gallery thinks the original photo is (cause I've replaced it), and have this result in pages that account for the increase in size of the "original" photo? Tried this - answer is no. Consider this a feature request. I undestand this could slow down the processing, so maybe there would be a checkbox called "verify picture properties are correct" someone can click when they're doing this. Still a very useful mod (and I was able to get the above to work by FTPing the old, before resizing, .dat and .bat files into the album directory when I FTPed the old original photos there as well). - Craig |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
Okay... feature requests you can submit to the RFE at SF.net. *DO NOT* just upload new images to replace old ones. Gallery needs to know exact dimensions etc. You can up the value for *future* photos in that album, but don't ever ever do anything directly to anything in the albums directory. Consider it entirely "off limits". Your idea sounds possible. BTW I'm planning on integrating the "myresize" stuff into v1.4.2 (already integrated the "resize on upload" stuff for 1.4.1). Oh... i recently found a potentially bad bug in my myresize code! I'll plan on fixing it very very soon. Basically... if you have any thumbnails where you've edited the thumbnail (to focus in on a particular area), and then resize the thumbs, but have already resized the originals using my code, the thumbs will either regenerate incorrectly for those images, or not generate at all. I need to edit the resizing code to update the "thumb region" data. Plan to do that soon. (Follow along in SF.net Bug #821073) -Beckett ( beck@beckettmw.com) |
|
obere
Joined: 2003-10-12
Posts: 14 |
![]() |
I've read this whole thread and am pleased to see this feature added in 1.4 so I won't try to hack my working Gallery 1.4 now. From my tests it looks like "resize on upload" still saves the original pic. Can I prevent this from being saved or have it auto deleted? |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
Er the point of "resize on upload" is that the original photo is resized. If you set the intermediate "sized" dimension to be the same as the resize-on-upload dimension, then only one file will be added (plus the thumb), which I think is what you want. -Beckett ( beck@beckettmw.com) |
|
PressureDrop
Joined: 2003-10-07
Posts: 6 |
![]() |
Grinch wrote:
...I heard that Gallery will soon offer integration with phpbb.... do any of the CVS version already do this? I suppose its a given that G2 will? |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
phpBB2 integration is slated for v1.4.2. However, it could be committed to the codebase within the next 2 weeks. -Beckett ( beck@beckettmw.com) |
|
latzke
Joined: 2003-09-30
Posts: 6 |
![]() |
beckett wrote:
Yeah. NetPBM and Jhead operations take forever. So the script is about as fast as it can be. If you use ImageMagick, it'll probably be a little faster. I am hitting the timeout (using ImageMagick) after a hundred or so images are resized. I try again, another 50 get resized. Try again, another 20. Try again, another 10. Etc. I'm at the point where I'm trying to resize one album (300-some pictures) and the timeout occurs before any pictures are resized (timeout period if consumed just checking already-resized pictures to see if they need resizing). This is one of my largest albums - I expect I'll run into issues with 5 other albums I have that are 250-500 pictures large. How can I make the timeout longer? Is there a parameter/variable, etc that determines/controls the timeout period? I've found nothing looking around the code or this forum, but I can't see why this wouldn't just be a variable set somewhere that I can change (and that "somewhere" is stumping me). I'm sure the timeout is set where it is for a reason, but I can't imagine there would be harm in changing it temporarily to resize the larger albums, and then setting it back to the default. Thanks, |
|
fritternyt
Joined: 2003-09-24
Posts: 14 |
![]() |
I am no programmer, but...... |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
fritternyt wrote:
I am no programmer, but...... Sure, and that will be in 1.4.1, and what killerblades fix does already. But once you've uploaded the files, you need a way of reducing them. |
|
obere
Joined: 2003-10-12
Posts: 14 |
![]() |
I'm sorry to bother you on this issue again, but in the following, where do you make the setting for "resize on upload." I can find "Resized image size" which mentions "When large images are added to an album, an intermediary version will automatically be generated at this size" but where do I create a setting for "resize on upload" to match what you said in the below. I have the "Resized Image Size" set to 600 in the Configuration Setup, but there is still a 1600 original file on the system which shows when clicking the 600px image on screen. I am using "v1.4-pl1" Thanks a lot. I really appreciate it. beckett wrote:
Er the point of "resize on upload" is that the original photo is resized. If you set the intermediate "sized" dimension to be the same as the resize-on-upload dimension, then only one file will be added (plus the thumb), which I think is what you want. |
|
goaweb
Joined: 2003-10-17
Posts: 30 |
![]() |
Hi everybody ! ;) I'm too lazy to read all the thread... But, my workaround is to use the Option: Options > Preferences > Upload > Resize before upload > Album default on Gallery Remote 1.1 . With that option I save a lot of space ! Bye ! |
|
latzke
Joined: 2003-09-30
Posts: 6 |
![]() |
How do I change the timeout? (Look up 5 posts if you don't know what I'm talking about). Thanks, |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Rerun config. wizard or edit config.php |
|
2fargon
Joined: 2003-10-25
Posts: 7 |
![]() |
I had myresize.php and myresize_funcs.php saved to the gallery folder, and the files in the images folder saved to images folder. Now, when I try to run myresize by doing I get a Error 500. It tried setting the permission of the myresize* files to 777 755 644 etc, yet it doesnt work. Any clue as to why I am getting this error? I even tried changing the auto-resize to off in config.php I am at my wits end and will appreciate all the help I can get. Thanks |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Upgrade to 1.4.1 (RC4 is just out). These features are now built into Gallery. |
|
2fargon
Joined: 2003-10-25
Posts: 7 |
![]() |
joan wrote:
Upgrade to 1.4.1 (RC4 is just out). I am sorry, but I cant find myresize.php in Gallery 1.4.1 RC4. Thank you for the pointer |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Bugger! I had thought beckett had code this into resize_photo.php (which is where it will appear). But it's not in 1.4.1. Sorry. Resize originals on upload is there, though. |
|
2fargon
Joined: 2003-10-25
Posts: 7 |
![]() |
joan wrote:
Bugger! I had thought beckett had code this into resize_photo.php (which is where it will appear). But it's not in 1.4.1. Sorry. It does resize, but it , for some strange reason, makes two copies, one .sized.jpg and one .jpg, both of the same size!! The " resize all " option in the albums doesn't seem to be working either. Should I file a bug report (then again, i currently dont know how to, but could learn from some faq). Thanks, Joan, I really appreciate you taking the time and interest!! I love you folks |
|
tomsawyer123
![]()
Joined: 2002-07-24
Posts: 81 |
![]() |
Beckett, I use your script for several month and it works great until today. I have rezised 250 pict which where 650p "max. size" to 600p "max. size" and I had an increase of 15mg! I don t understand. All my album are set to " no resize". I have try to decrease the quality of jpeg in the setup process form 90 to 80 and resize all those 250 pics again and it didn't improove the situation. I month ago, i have change the gallery code for the image to be resized on upload. Is it possible that there is a bad interraction with those two codes? Is it possible to choose the jpeg quality of the pictures resized by myresize.php. Thanks for your help. Tom |
|
Vidman
![]()
Joined: 2002-07-20
Posts: 38 |
![]() |
myresize r0X0r5!!!!1 113 albums, 2725 images running 1.4.2: I went from 710 megs to 449 in one sweep! No timeouts, no problems. It took 3-5 minutes to complete. However, in order to run myresize.php I had to increase the php memory limit from 10 to 15. I stuck this in my root .htaccess: <IfModule mod_php4.c> Prior to running the script I changed my config to the following: In myresize.php I specified 600 as the max size, and left the .sized textbox blank. This got rid of all the .sized images and shrunk the originals down. The size of some of the images my users uploaded was rediculous.. some were pushing 1MB!! This script recovered 261 megs. |
|
schillid
Joined: 2004-03-23
Posts: 1 |
![]() |
Any word on getting myresize.php to work with embedded galleries? I'm running gallery with phpBB and would love to have this! |
|
grafikat
Joined: 2004-03-31
Posts: 8 |
![]() |
I just upgraded, and was looking at the resize function. When to the website, and his gallery is broken! is this because resize does not work with the new update? Just wanted to know before I tried it Cheers |
|
beckett
![]()
Joined: 2002-08-16
Posts: 3474 |
![]() |
myresize v0.3 available: http://beckettmw.com/testgallery Should fix the issues you're having. -Beckett ( beck@beckettmw.com) |
|