# Gallery2: replace (not delete and reupload) photo?

**URL:** <https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200>\
**Category:** Factual Questions\
**Created:** [September 7, 2009, 9:40pm UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200 "2009-09-07T21:40:22Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [September 7, 2009, 9:40pm UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/1 "2009-09-07T21:40:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Reply](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/reply/32/15952_2.png) [@Reply](https://boards.straightdope.com/u/Reply)\
**Post date:** [September 7, 2009, 10:06pm UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/2 "2009-09-07T22:06:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [September 8, 2009, 4:38am UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/3 "2009-09-08T04:38:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [September 8, 2009, 4:42am UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/4 "2009-09-08T04:42:16Z")

</div>

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](http://gallery.menalto.com/forum).

---

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [September 8, 2009, 4:45am UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/5 "2009-09-08T04:45:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [September 8, 2009, 5:10am UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/6 "2009-09-08T05:10:48Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [September 8, 2009, 7:52am UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/7 "2009-09-08T07:52:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [September 10, 2009, 6:15am UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/8 "2009-09-10T06:15:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [September 10, 2009, 9:25am UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/9 "2009-09-10T09:25:38Z")

</div>

> [@Kaio](#):
>
> 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’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

---

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [September 11, 2009, 5:12pm UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/10 "2009-09-11T17:12:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [September 11, 2009, 5:25pm UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/11 "2009-09-11T17:25:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [September 11, 2009, 11:39pm UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/12 "2009-09-11T23:39:53Z")

</div>

> [@Kaio](#):
>
> Edit photo\> Modify Photo\> only allows Rotate and Scale, along with a checkbox to preserve the original file.

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).

> [@](#):
>
> $gallery-\>setConfig(‘data.gallery.base’, ‘/opt/joomla/gallery2/g2data/’);

Si

---

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [September 13, 2009, 4:31pm UTC](https://boards.straightdope.com/t/gallery2-replace-not-delete-and-reupload-photo/509200/13 "2009-09-13T16:31:43Z")

</div>

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? 😃
