I updated from CVS, and looks like square thumbnails aren't working properly... when I regenerate thumbnails from new images (which have recently been rotated), they're no longer square. Instead, they're very narrow (these were all portrait). Recent bug perhaps?
----
Gallery URL (optional):
Gallery version: CVS from 6/27/06
Webserver (with version): Apache 1.3.33
Datatabase (with version): MySql 4.0.15-log
PHP version (eg 4.2.1): 4.3.7-10
phpinfo URL (optional):
Graphics Toolkit(s):all
Operating system:Debian Linux
Web browser/version:Firefox 1.04
G1 version (for migration bugs):
Posts: 30
Update: I tried using ImageMagick as the top package vs GD... the thumbails are now no longer super skinny, but they're still not square. Hmmm....
Posts: 8601
perhaps deactivate all toolkits (im,gd,netpbm,squarethumb) then reactivate.
what is your squarethumb configuration? (what is selected in site admin?)
Posts: 30
Weird... I disabled the square thumbs and recreated thhumbs on an album... all the prints I hadn't rotated were fine, and the ones I had (to portrait) were also properly displayed. I re-enabled square thumbs, and all the landscape thumbs turned square. However, the portrait once got skinny again.
Is there some way to turn on logging to see what commands are being used to make the thumb?
Posts: 32509
in config.php, you can activate buffered (or immediate) debug mode. the you'll see which commands are executed.
Posts: 8601
i tried a portrait photo with crop-to-square with all 3 toolkits as top priority, didn't see any problems.
Posts: 30
Check out the long portraits on http://www.whizzyfoo.com/gallery2/v/2000/2000-12-24_Christmas/
feel free to DL the originals and see if they exhibit weird scaling problems on your end. I looked at the debug output (will send more later tonight) and didn't see a problem, so I'm wondering if it's something weird with the image itself.
Posts: 8601
I clicked the xmas tree pic there.. the page says the full size is "1760x1168" and when I click to see that size it shows it stretched horizontally.. if I do "view image" in my browser I see the image is actually 1168x1760.. what method did you use to rotate the photo? In G2? was the "preserve original" box checked?
So probably squarethumbs is ok, but these dimensions are throwing off its calculations..
Posts: 30
I actually used jhead -cmd jpegtran -rotate 270 or 90... weird that it didn't reset the dimensions, but I'll check on that and see if there isn't something wacky with the script.
Gallery2 doesn't store dimensions, does it? I added the item, noticed they weren't rotated, rotated them, then attempted to regenerate things.
-e
Posts: 30
the answer, apparently, is yes.
I solved the problem by updated values in g_PhotoItem (width and height) and removing the corresponding entry in cache/entity
Storing the width / height seems somewhat weird... or at least upon re-creation of something they should be validated with what the file actually is. Is there a good reason to store them (vs say storing things on a disk cache?)
Posts: 32509
sure, usually you don't modify the files in g2data/albums/, they are managed by G2. storing meta data about the files in the database is done for performance reason. and it's much easier to search all items for given meta data criteria. there's nothing that speaks against storing the information in the database. nothing but the fact that you can't just modify the stuff in g2data/albums/ without telling G2 about it.
Posts: 30
Right... I have a weird install. I'm using symlinks, so I can use both gallery2 and album at the same time on the same files. album requires you to muck with the files and doesn't care to know, as it re-generates things when you blow away the old thumbnails.
Posts: 30
still, might make sense for a "sanity check" button that forces gallery to look at the image and update the height / width and invalidate any derivative images if the underlying file has changed.
Posts: 32509
there is a small percentage of G2 users that use it the same way as you do. so a maintenance task that refreshes the state of the items would be nice. in addition, an admin link in the edit item / edit photo views to just refresh this single item would be good too.
but we don't have the resources to work on it right now.
please add a feature request on http://sf.net/projects/gallery/ such that we don't forget this. add [G2] in the title of the RFE and add a link to this forum thread in the long description of the RFE.
thanks.