[SOLVED] mass re-upload
HeikoSchlittermann
Joined: 2012-11-24
Posts: 4 |
Posted: Sat, 2012-11-24 21:50 |
Hello, I'd like to do a mass re-upload. I found the the hint to the reupload module (see http://gallery.menalto.com/node/54127). Without any problems I can update the files in the album folders, but - Thank you for any hint. |
|
Posts: 8339
are you uploading larger/smaller versions w/ the same filename?
or has the aspect changed?
-s
________________________________
All New jQuery Minislideshow for G2/G3
Posts: 4
I'm uploading larger pictures (same aspect ratio). (Because unfortunately during the initial upload via gallery remote the resize checkbox was checked.)
(PS: I'm already playing with the database (tables g2_filesystementity and g2_photoitem) and changed the g_width and g_height fields to
match the orginal (and replaced picture), but this does not seem to work. - may be there is some caching or some other place where
the size is stored too.)
EDIT: Just purged the database cache. It seems that now G2 took the new size.
EDIT2: The issue seems to be solved - just the question, if there is
some simpler solution, remains.
What I did (and have to do for the about 500 items)
- replace the file in the album/** folder with the
new version
- find the new dimensions (using "jhead")
- update the database (update g2_photoitem set g_width = $WIDTH,
g_height = $HEIGHT where g_id = (select g_id from g2_filesystementity
where g_pathcomponent = '$FILENAME');
- purge the cache of the database
Fortunately I've uniq filenames - thus the g_pathcomponent is unique
too.
The about outlined solution is scriptable (perl, shell or whatever).
--
Heiko
Posts: 8339
it would be fairly simple to write a filesystem iterator to walk the filesystem from g2data/albums and grab the $item's id -> load $item by id -> $item->setHeight($h) -> $item->setWidth($w) -> $item->save()
-s
________________________________
All New jQuery Minislideshow for G2/G3
Posts: 4
Yep. Seems to be about that what I've outlined. But you're using the G2-API, aren't you? (I do not know that API, it's the reason for my stupid perl/shell/sql approach.)
Posts: 8339
http://codex.gallery2.org/Gallery2:API
-s
________________________________
All New jQuery Minislideshow for G2/G3
Posts: 4
Thank you. I'd say it's solved. At least I know, what to do