Image aspect ratios for very tall images

(Scott Hess) #1

I notice that some images on the Herculian import, such as the image here:
I cannot express how happy I am.
are oddly squashed vertically. There are a couple image caps like that post further down which aren’t as egregious. They seem to always be coded to 690x500 in the HTML, even though the images themselves are of varying sizes.
It could just be the import, because it seems to correlate with that.

Hmmmmm. I also notice that these imported images don’t get the mouse-over info box like this:
Tool Rescue Sunday
So maybe it’s that there’s meta-information missing or wrong in some database.


(Anthony Bolgar) #2

I am surprised that we were even able to import all the G+ communities that we have. Ther importer script is not perfect, but @mcdanlj has done an amazing job saving all the knowledge that was in these groups. I am sure he will have an answer for you, most of what he does is like black magic to me. :slight_smile:

(Michael K Johnson) #3

Sadly, it’s not obvious to me. I used generic functionality of the importer to post those images; there was nothing magic to limit the size. I expect it’s an oddity of the import functionality.

It looks like rebuilding the HTML fixes it. I did that for the “I cannot express” post and now it looks more normal. I think the hover only happens for images that are shrunk for display and not for images for which the inline image is the original size.

I’m sure @funinthefalls is super excited about the idea of “rebaking” all the posts on this site in a few weeks after we’re done importing all the images :rofl: , but it looks like that will fix the problem.

I plan to focus primarily on imports while G+ is still on life support, on the theory that we can tweak this later.

(Anthony Bolgar) #4

Ya, rebaking is my favorite thing right after watching paint dry…lol

1 Like
(Scott Hess) #5

My best guess is that this isn’t anything which would be improved by revisiting the original G+ post, so seems completely reasonable to not prioritize it. Probably just a minor bookkeeping thing somewhere.

(Michael K Johnson) #6

It’s a bug in Discourse’s generic import functionality. It just trims both height and width independently without attempting to preserve aspect ratio.

This means that we can rake posts:rebake_match["x500]"] after all the imports finish and dollars to donuts it fixes the problem. (Or, at the cost of donuts these days, donuts to dollars? Anyway, I digress.)

(Michael K Johnson) #7

I think I have a fix for the next communities I import, and after I finish importing the 3D Printing community I think I have a method to fix up most or all of the affected images.

Update: I have successfully tested a fix for this on my development system, and am running the fix here. Might take a few hours to finish the process, but it shouldn’t look weird like that for much longer. I also modified the import script to not create this problem with future imports.

(Michael K Johnson) #11

It looks like my fix, though effective on my test system, has caused a storm of image reprocessing that is responsible for the site being a bit slower. @funinthefalls kindly threw more processing and memory resources at the system to improve this, but if the site still feels sluggish, my attempt to fix this is probably responsible. My apologies!

(Scott Hess) #14

Unexpected complications is the story of my life. Thanks for looking into this! At least on the thread I mentioned, the images now look nicely “native” to the system.

(Michael K Johnson) #15

Yeah, that one I rebaked right away. If you see ones that still have the problem, it’s worth mentioning them here so I can look into them. Thanks!