Gallery2: replace (not delete and reupload) photo?

Is there anyone familiar enough with Gallery2 software who can tell me how (if it’s possible) to replace a photo in a gallery? I’m not talking about deleting the photo, then uploading another copy of it. I’ve made some minor edits to the photo, and would like to put the modified version into the gallery, but without losing the viewcount, comments, etc… essentially swapping out the image in that particular DB record, but leaving everything else alone.

Is this possible? How would I go about doing that?

Thanks.

Can you FTP in and find the source image and simply replace the jpeg without touching any of G2’s data?

I have no idea where within the DB the source images are stored, no. No idea how the back-end works.

Unless Gallery2 was designed by a simpering dunce, the images would be stored on the filesystem somewhere. If you have access to the server, try to do some exploring and see if you can find them.

You could also try the Gallery 2 forums.

I’ve already gone digging through the DB via PHPMyAdmin. No idea – I only have the barest grasp of DBs anyway, and I can’t find anything that looks like it’s an image file, just ID numbers and height and width indicators and a bunch of other crap. All of it numerical, nothing that ends with .jpg.

The names of the tables don’t match the URLs assigned to the pages, and it’s not in any way clear from the table names what they’re supposed to be, either.

They’re not talking about looking in the database for the files, they’re talking about looking in the web site’s file structure for the original files and replacing them.

For that you’ll need to connect to the web server using FTP and look for the files. Nothing to do with MySQL (unless the images are actually stored in the DB as blobs but you’re better off looking in the filesystem first)

The photos (in a default install) are stored in ./gallery2/g2data - on my setup, I use symlinks, but you may not.
However…
If you select your photo, choose Edit Photo, select the Modify Photo tab, there is a Reupload Photo option. Try that.

Si

What version of Gallery2 are you using? Cuz in 2.3 there is neither a Reupload Photo option, nor a g2data folder. I can’t find a folder name that would indicate where in heck the photos are stored. I can’t find anything but .php and .js files.

I’d guess that it’s stored in the DB somewhere, but the table names aren’t incredibly intuitive, either.

I’m using Gallery2 2.3 core 1.3.0.

Do you have a Modify Photo tab when you select Edit Photo from the <item action> menu?
What operations are allowed?

Si

Edit photo> Modify Photo> only allows Rotate and Scale, along with a checkbox to preserve the original file.

As for the actual file directory structure, all I’ve got are:
[ul]
[li]images (Gallery2 native images, like the G2 logo)[/li][li]install[/li][li]lib[/li][li]locale[/li][li]modules[/li][li]themes[/li][li]upgrade[/li][/ul]

Locale seems to be language files. The others are pretty self-explanatory, and I’ve dug around them anyway to be sure. I’ve tried Lib, thinking it was a library directory, but I can’t find anything like a photo folder.

There doesn’t seem to be an obvious way to check which core module I have, either. The README file only says v2.3 (Skidoo). There doesn’t seem to have been any recent updates to the software – I’ve only updated once after my initial install about a year ago, because they added comment moderation in. Not sure how long ago that was.

Found the build date, if not the core version: Jul 24200922:36:41.

Go to Site Admin, select Plugins. Under Extra Data is the Reupload Module, activate this.

To figure out your data directory, look in config.php (in your gallery folder).

Si

Oh, thank you! I didn’t have the reupload module, so I did a quick Google and installed it. It’s in the modify photo tab just where it’s supposed to be.

So are there any other handy not-out-of-the-box modules I’ve been missing out on? :smiley: