Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate vips, a quick thumbnailer that manages smart gravity for square thumbnails #1683

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

Daniel-KM
Copy link
Contributor

@Daniel-KM Daniel-KM commented Jan 27, 2021

A new thumbnailer, that has the main quality to be very quick (5 to 10 times quicker than ImageMagick, as the ad says). It is the one used by wikipedia, but it is implemented directly here, without extension.

I added a second thumbnailer "auto", in order to simplify the choice for the admin.

A point to check is that it is recommended to use a recent version (>= 8.6), because there is an interesting feature, the possibility to crop the square thumbnail according to the point of attention, that may not be the center (gravity). Nevertheless, it is not yet in the stable packages of the common linux server distributions.

As usual, it is already implemented in a module, the module Image Server, since some weeks. Indeed, it can be used to tile jpeg2000 and pyramidal tiff dynamically without the need to pre-tile images. Last version can manage pyramidal iiif images too.

@Daniel-KM Daniel-KM changed the title Feature/vips Integrate vips, a quick thumbnailer that manages smart gravity for square thumbnails Jan 28, 2021
@zerocrates
Copy link
Member

I'll have to get a hold of vips so I can try this out.

In principle I'm in favor of it, nothing wrong with more options.

$mapImagickToVips = [
'northwest' => 'high',
'north' => 'high',
'northearth' => 'high',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a typo for "northeast" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed in last commit

$tempFile->delete();

$command = sprintf(
'%s thumbnail %s %s %d --height %d%s%s --size both --linear --intent absolute',
Copy link
Member

@zerocrates zerocrates May 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, "both" isn't always appropriate for "size" here: the other thumbnailers don't scale up, only down (except for the "square" type).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed in last commit.

@zerocrates
Copy link
Member

Can you explain what's going on with the usage of vips vs vipsthumbnail? It seems like vipsthumbnail has support for doing pretty much everything we'd want: specifying the size, scale up/down/both, crop type with --smartcrop, --rotate, the options for output...

It seems to me like this could just always use vipsthumbnail, so I'm wondering what the rationale is for the other strategy.

@Daniel-KM
Copy link
Contributor Author

About the choice on "vips"/"vipsthumbnail" : i created the thumbnailer for the module Image Server and it requires some complex parameters to manage iiif requirements, so i worked with vips and the same here. Options are not exactly the same, so it's simpler to keep the same command line whatever the help said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants