¿ªÔÆÌåÓý

Photo section re-upload experience


 

The need for an online photo resize operation has come up here a
few times in the past. Since no such online facility exists, I've
now been through the alternative process, and thought I'd share it.

I just went through the (tedious) process of reuploading all of the
oversized pictures in my group's Photos section. The original group
owner had neglected to enable resizing. Whether by glitch or grace
factor, we were occupying 1.3Gb. After reuploading, we're down to
just 323Mb, using a 1024x1024 cap. (Woohoo!)

As a precaution, I first got an exported zip backup, so I had all of
the data I needed in case I screwed up royally. That also let me
experiment, to see how much space we'd save after resizing. So I
knew it would be worthwhile before starting.

My process was to first individually delete each photo in an album, in
order to preserve the album's "shell", which preserved the original
creation date, owner, description. I then re-uploaded from copies
that came from the zip export.

The uploads were made easier with some commandline scripts that
ensured that my browser's default upload directory always pointed to a
directory containing only the files from the album I was working on.
(There were symlinks involved.) Also, the per-image json files had all
been moved elsewhere, so that they didn't interfere with a
multiple-select when uploading.

Before starting I had processed the json files so I had the
"Description" data in a form I could easily work with, using full-line
copy/paste. Happily, most photos don't have descriptions, but for
those that did, I could quickly paste them into place.

We have something like 1300 pictures across about 180 albums. Many
pictures were already appropriately sized, but if even a few were too
big, I usually redid the whole album, rather than having to carefully
pick and choose.

I did "screw up royally" twice, while in the really boring per-Photo
"Select-->Edit->Delete->Confirm" cycle. Somehow I managed to (twice!)
skip the "Select" part, and then hit Edit, Delete, and Confirm on the
_album_ instead of on a photo. Dumb. But since I had the photos
already in the zip, all I really lost was the albums' creation times.
Oh well.

But I had to deal with some "surprises" in the zip file:

Duplicates:
Many albums contained duplicate filenames, so when unzipping the
folders there were conflicts. My zip extracter (linux "unzip")
doesn't have a "disambiguate" option, so there was extra manual
work to rename the duplicates.

AFAICT, the duplicates came from three sources:
- Many albums had multiple files named "image.jpeg", sometimes
every photo in the album. These might come from
drag-and-drop, but that's just a guess.
- In some cases it was clear that the identically-named files
were, in fact, identical, and that the user had simply
uploaded the second by accident.
- In many cases the user had renamed the files after upload, to
give them a "meaningful" name. Sometimes the same name was
chosen for more than one picture.

Missing extensions:
Uploaded photos can be renamed by the user (see last bullet,
above), so that, for example, a photo of a pansy can be "Pretty
Flower" instead of "DSC_12357.jpg". (Yes, there's also a
Description that can be modified, but either works as far as the
user is concerned.) When "Pretty Flower" is exported, the original
suffix is lost, and the groups.io uploader won't reaccept the
files. So they need to have the ".jpg" added back on. Except
that they might be PNG, GIF, etc, so you need to identify the file
type before renaming.

All in all, it wasn't a horrible project, and took maybe 6 or 8 hours,
once I got going. Hope this helps anyone that might be considering
doing it.

paul
=----------------------
paul fox, pgf@... (arlington, ma, where it's 68.9 degrees)

Join [email protected] to automatically receive all group messages.