Retouching photos

BentFranklin

Joined: 2012-04-24
Posts: 32
Posted: Sat, 2012-04-28 05:42

Say I want to retouch a photo or trim some edge garbage off. I find that if I save the updated photo where it came from in var/albums, and I reload the album, the new version appears, but only when full size. Is there a way to have Gallery notice when some thumbs are out of date and only recalc those that are older than their respective photos?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25936
Posted: Sat, 2012-04-28 06:05

The rebuild items module might work but if the size has changed then you might experience some undesirable results.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
BentFranklin

Joined: 2012-04-24
Posts: 32
Posted: Sat, 2012-04-28 06:13

If a photo has tags and comments already, then deleting it and re-uploading won't work correctly.

Is there a best practice for updating a photo in g3?

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Sat, 2012-04-28 12:40

I don't know what the official best practice is, but here's how I do it:

1. Without changing the file name, ftp the new version of the photo, overwriting the original

2. Click the photo in the album.

3. From the admin menu at the top, choose Photo Options > Rebuild item

4. Select Mark dirty the thumb for this item.

5. Click the Commit changes button.

6. A link at the top of the page appears that says, "One or more of your photos are out of date. Fix this now on the maintenance page" Click the link

7. You land on the Maintenance page, where Rebuild Images has a yellow info triangle. Click the Run button.

8. Repeat steps 2 through 7, however, in step 4, select Mark dirty the resize for this item

Since ftp doesn't affect the database, using the same file name preserves everything the database knows about the photo: tags, views, comments, etc.

This won't work if you use a different extension, since you can't overwrite the file, and I don't know what happens if you upload a difference size of the same photo.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 598
Posted: Sat, 2012-04-28 12:51

If someone can describe how this worked in G2, (how you went about doing it - explanation) I can try and work up a module for it.

With BillWill's description of how he does it, I think this can be made into a module. Is there really a major desire for this?

 
BentFranklin

Joined: 2012-04-24
Posts: 32
Posted: Sat, 2012-04-28 15:14

Thanks, Bill.

I am assuming the Rebuild Photo option comes from the rebuild Items module. The download page for that module says "This module is not designed for the manual replacement of the original item(s). Especially if the size or aspect ratio is changed." Many of my edits will change the size as I crop off borders from scans.

I threw a few hundred photos up initially through Server Add to see how Gallery would work, but now my family is already tagging stuff, so it would be inconvenient to wipe out the albums and restart, although if I am going to do it, now is the time before it gets worse.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25936
Posted: Sat, 2012-04-28 19:55

In G2 this is how it was done:
edit the photo and you where presented with a bunch of tabs depending on the different module you had active. You chose the tab:

Quote:
Reupload Photo

Upload a new revision of this picture instead of the old one.

Note: The new file cannot be larger than 32 megabytes. If you want to upload a larger file you must ask your system administrator to allow larger uploads.

You browsed for a new file though the form upload and it overwrote the original (if you wanted to (check-box)) and once you uploaded it it regenerated the thumb and resize(s). I don't know if it redid the tags and description and other meta data.

I think this could be done in G3 extending the edit photo dialog with a form to add a new item and use some of the code in the rebuild items module to regenerate the thumb and resize as well as scan the tags and IPTC info.
The rebuild items module does not of that now but with some steps as was pointed out above.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

AttachmentSize
Gallery_tab_g2.png22.86 KB
 
BentFranklin

Joined: 2012-04-24
Posts: 32
Posted: Sat, 2012-04-28 21:43

I did a couple of photos, cropping them to change the size, and Rebuild Items worked fine. floridave, you are the author of Rebuild Items. Why does it have a disclaimer about photo resizes?

 
BentFranklin

Joined: 2012-04-24
Posts: 32
Posted: Sun, 2012-04-29 00:27

I've done several albums now with no ill effects. If I get a chance I'll try to see why you can't rebuild resizes and thumbs at the same time.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25936
Posted: Sun, 2012-04-29 01:54

The size in the DB is the size of the item was first added. If you only changed it by few pixels I don't see any major issues.
if it was changed significantly then I bet you would have some undesirable affects.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
BentFranklin

Joined: 2012-04-24
Posts: 32
Posted: Sun, 2012-04-29 04:05

I see. It affected the aspect ratio of the full size display. I changed the height and width in the DB directly and it displayed correctly. Is there anything else I should have changed? Should I have changed those prior to rebuilding thumbs and resizes? Or am I just totally screwing things up?

 
BentFranklin

Joined: 2012-04-24
Posts: 32
Posted: Sun, 2012-04-29 04:41

It looks like Rebuild Graphics uses the file and not the DB width and height, so you can do them in any order.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 598
Posted: Mon, 2012-04-30 00:07

Well, I've looked in to doing a module for this, but I think it's far too involved for the benefit gained from doing it manually. If there is more interest, then perhaps I'll take a re-look. For now, I'm sorry, too busy at the moment.