Include image dimensions for <preview> images

VERIFIED FIXED in 6.1.3

Status

P3
normal
VERIFIED FIXED
8 years ago
3 years ago

People

(Reporter: Unfocused, Assigned: andy+bugzilla)

Tracking

unspecified
6.1.3

Details

In the detail view of the addons manager, we show one of the images we get from the AMO API. At the moment, we don't know before-hand what size that image is. So when the image loads, it suddenly takes up space - making most of the UI element jump in a not-very-nice kind of way. We can fix this if we know the image dimensions.
Blocks: 664895
Should be no need to increment the API for this, just add to 1.5.
Assignee: nobody → amckay
Priority: -- → P3
Target Milestone: --- → 6.1.3
(Assignee)

Comment 2

8 years ago
We resize all preview images, but we don't scale them, we resize to largest bounding x or y. So we get image sizes that vary, but will always be max of one of x or y.

https://static-cdn.addons.mozilla.net/img/uploads/previews/thumbs/55/55569.png?src=api&modified=1306911147 is width 200px

https://static-cdn.addons.mozilla.net/img/uploads/previews/thumbs/55/55570.png?src=api&modified=1306911147 is width 150px

Those dimensions we resize to are 200px wide, 150px high and 700px wide and 525px high. 

Would it make sense to just use those dimensions, then your layout will be easy to do as they are consistent? This is what we do on the site in our layout.

I can add those resize dimensions to the API, or the actual image dimensions (something we currently don't store), but I don't think the actual image dimensions will be a great deal more useful.
We display the thing in the <thumbnail> tag, so the sizes of that would be what we're after. By my reckoning a width= and height= attribute on the tag would make sense. At some point in the future we might allow showing the full images so having those dimensions might be useful if they are easy to do right now, but it sounds like they aren't so probably not worth thinking on it much.
(Assignee)

Comment 4

8 years ago
Do you want the max-width and max-height or the actual width and height? We pretty much only use the max-width and max-height in our designs.
I think the max would be enough and allow us to give a consistent look between add-ons details, what do you think Blair?
Unless we put the image in a fixed-size containing box (which would look odd for images that aren't roughly square), I think we'd need the actual dimensions to lay it out properly.
(In reply to comment #6)
> Unless we put the image in a fixed-size containing box (which would look odd
> for images that aren't roughly square), I think we'd need the actual
> dimensions to lay it out properly.

^ This. Max width/height would be better than what we have now, but it's not ideal.

Ideally, I want to reserve the exact amount of space the image will take up when it's loaded - which requires the actual dimensions.
(Assignee)

Comment 8

8 years ago
Alright, will do.
(Assignee)

Comment 9

8 years ago
https://github.com/jbalogh/zamboni/commit/428e989410ecb03bb96810e1aa4551dc97c3cb43
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Comment 10

8 years ago
verified fixed at https://addons-next.allizom.org/en-us/firefox/api/1.5/addon/324018
Status: RESOLVED → VERIFIED
Why does this addon have no dimensions (or a modified time, apparently)?
https://services.addons.mozilla.org/en-US/firefox/api/1.5/addon/inspectthis
(In reply to Geoff Lankow (:darktrojan) from comment #11)
> Why does this addon have no dimensions (or a modified time, apparently)?
> https://services.addons.mozilla.org/en-US/firefox/api/1.5/addon/inspectthis

It's older than when we started doing modified hashes?  just a guess
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.