api icon indicating copy to clipboard operation
api copied to clipboard

Completely fill requested dimensions for image size

Open azaroth42 opened this issue 7 years ago • 10 comments

From: https://twitter.com/digitopia_nl/status/984466230751973377

A resize mode that begs to be added is like '!w,h' but now with a resulting width and height are greater than or equal the supplied box. Now my box is always fully covered, proportions are kept. CSS deals with the overflow. Let's call it 'w,h!' ?

azaroth42 avatar Apr 12 '18 17:04 azaroth42

A good candidate to road test the extension process for syntax extensions?

tomcrane avatar Apr 12 '18 17:04 tomcrane

More on the use case:

On a webpage various images are displayed. Since all images have different proportions, the display is standardized to identically size square boxes that are fully filled. However, these images - thumbnails - also serve as the preloaded low res version for an image gallery. For that purpose, they need to maintain the original proportions.

These requirements can be matched by having the image server return an image that completely fills the requested box. The overflow can be simply handled using CSS.

An example where this is implemented (but not yet using the IIIF API) can be found at https://vici.org/vici/49/ (specifically the images on the upper right hand corner, decorated with a magnifying glass).

renevoorburg avatar Apr 13 '18 05:04 renevoorburg

Is that latter use case the same as square? http://iiif.io/api/image/2.1/#region

And is w,h! where w == h the same as square?

And if so, could the square syntax be dropped, and replaced by the generalised w,h!?

tomcrane avatar Apr 13 '18 08:04 tomcrane

In my use case I am interested in the full image, the width / height ratio unaltered. The part that is actually shown to users happens to be square, but that might have been different.

The resulting width and height should than or equal the supplied box, preferably using the smallest size that actually covers the box.

renevoorburg avatar Apr 13 '18 09:04 renevoorburg

example

/square/200,/0/default.jpg

/full/200,200!/0/default.jpg

tomcrane avatar Apr 16 '18 18:04 tomcrane

Square does cropping -- the requested w,h! functionality would overflow ... potentially a lot in the case of scrolls.

Eds meeting: Not a candidate for 3.0 given the number of use cases and lack of implementations. It's backwards compatible so could be added in 3.1. It makes a good syntax extension example for 3.0, encouraging implementation and experimentation.

Propose to write it up as an extension, and defer adding to the spec until 3.1, pending implementations and use.

azaroth42 avatar Apr 16 '18 18:04 azaroth42

Clarifying: Someone should write up the extension. Until there's implementations of that extension, we'll defer adding to the specification. (From 2018-09-14 eds call)

azaroth42 avatar Sep 19 '18 16:09 azaroth42

How's this for a writeup on the extension?

image

beaudet avatar May 28 '21 21:05 beaudet

ping...

beaudet avatar Jun 10 '21 17:06 beaudet

pong? Sorry!

azaroth42 avatar Jun 07 '24 22:06 azaroth42