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

Fix svg images not supported by imaginary autorotate #35823

Closed
wants to merge 1 commit into from

Conversation

grusch-it
Copy link

@grusch-it grusch-it commented Dec 19, 2022

Summary

Pull request #31829 added the autorotate operation as first operation sent to imaginary. For svg images, this will fail with the following error messages:

  • using the official h2non/imaginary docker image: Error while processing the image: VIPS cannot save to "svg"
  • using imaginary docker image from the nextcloud aio package: Error while processing the image: Unsupported image output type

As soon as the autorotate operation is removed from the imaginary pipeline, the svg image is correctly resized (fit) and converted to an jpeg image.

This PR skips the autorotate operation if the mime type of the image is:

  • image/svg+xml
    or
  • image/svg

Additional notes

The imaginary pipeline API operation has an option ignore_failure for each operation. If this option is enabled for an operation, that operation should fail silently and the pipeline would continue with the next operation without failing.

Unfortunately that did not work for me.

Signed-off-by: Michael Gruschwitz <info@grusch-it.de>
@szaimen szaimen added this to the Nextcloud 26 milestone Dec 19, 2022
@szaimen szaimen requested review from pulsejet, a team, ArtificialOwl, blizzz, come-nc and st3iny and removed request for a team December 19, 2022 13:45
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

IMO, this workaround seems a bit hacky. However, SVGs don't have exif metadata so the autorotate step is obsolete anyway.

LGTM!

@szaimen szaimen requested a review from J0WI December 19, 2022 20:09
@blizzz blizzz mentioned this pull request Feb 1, 2023
@skjnldsv skjnldsv mentioned this pull request Feb 23, 2023
@blizzz blizzz mentioned this pull request Mar 7, 2023
@blizzz blizzz modified the milestones: Nextcloud 26, Nextcloud 27 Mar 9, 2023
@solracsf
Copy link
Member

Conflicts to be solved after #36546

@szaimen
Copy link
Contributor

szaimen commented Mar 11, 2023

Svg should work correctly already

@szaimen szaimen closed this Mar 11, 2023
@szaimen szaimen removed this from the Nextcloud 27 milestone Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants