Project

General

Profile

Actions

Feature #1426

closed

API: Display image smaller size

Added by Bernhard Koschiček-Krombholz about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
Start date:
2021-04-02
Estimated time:

Description

Some images can be very large in file size. Since the API should also provide data for different front-ends, it can be useful, that API clients can forcefully downsize images. One idea is, that the normal display path will show the full image. With parameters the client can demand a 30% size version of the image. Or the image pixel size will be downsized to a number like 1200px. The path will be /api/display/image.jpg?size=30 or /api/display/hsize=1200 or /api/display/vsize=1200 (horizontal and vertical size)

If python can not do it by itself, maybe the Pillow package can do this.


Related issues 3 (0 open3 closed)

Related to OpenAtlas - Feature #1280: Picture PreviewClosedBernhard Koschiček-Krombholz2021-04-02Actions
Related to OpenAtlas - Question #1517: decide on/implement content negotiation for image APIClosedBernhard Koschiček-Krombholz2021-05-17Actions
Follows OpenAtlas - Feature #1492: Image Processing ClosedBernhard Koschiček-Krombholz2021-04-01Actions
Actions #1

Updated by Alexander Watzinger about 4 years ago

Actions #2

Updated by Alexander Watzinger about 4 years ago

My take on this is that we will need some image processing in OpenAtlas sooner or later anyway. I linked a related issue about previews and although nobody wrote a ticket so far some people mentioned they would like a slideshow and similar. Once we have solved this for OpenAtlas (thumbnails, previews, slideshows, ...) we could decide if this is sufficient for the API too or if we would need extra functionality there.

What would be needed now is a volunteer who delves into this topic and drafts a solution proposal which we can than discuss together ;)
I started a draft and everybody is welcomed to join/take over: Image processing

Actions #3

Updated by Bernhard Koschiček-Krombholz almost 4 years ago

I tried to play around with Pillow, but sadly couldn't make it work on my machine.

Actions #4

Updated by Bernhard Koschiček-Krombholz almost 4 years ago

pillow has no buster package... I looked into pythonmagick (https://packages.debian.org/buster/python3-pythonmagick) and found Wand (https://packages.debian.org/buster/libmagickwand-dev) with following documentation: https://docs.wand-py.org/en/0.6.5/.
Alex, can you look at the package https://packages.debian.org/buster/libmagickwand-dev and tell me, if this will work with OA installations?

Actions #5

Updated by Bernhard Koschiček-Krombholz almost 4 years ago

If now more and more projects asks for IIIF standard, maybe it is better to got straight to IIIF implementation?

Actions #6

Updated by Bernhard Koschiček-Krombholz over 3 years ago

  • Start date changed from 2020-12-01 to 2021-04-02
  • Follows Feature #1492: Image Processing added
Actions #7

Updated by Bernhard Koschiček-Krombholz over 3 years ago

  • Status changed from Acknowledged to In Progress

Feature is done, testing and mypy in progress

Actions #8

Updated by Christoph Hoffmann over 3 years ago

  • Related to Question #1517: decide on/implement content negotiation for image API added
Actions #9

Updated by Bernhard Koschiček-Krombholz over 3 years ago

  • Status changed from In Progress to Resolved

It is possible to get different sizes of images through an API request at the endpoint http://127.0.0.1:5000/api/display/ and the parameter image_size. Possible arguments are: 'thumbnail' (200px), 'table' (100px).

Actions #10

Updated by Bernhard Koschiček-Krombholz over 3 years ago

  • Status changed from Resolved to Closed
  • Target version changed from 208 to 6.4.0
Actions #11

Updated by Alexander Watzinger over 3 years ago

  • Subject changed from API: display image smaller size to API: Display image smaller size
Actions

Also available in: Atom PDF