Skip to content

Conversation

@solracsf
Copy link
Member

@solracsf solracsf commented Oct 25, 2023

Summary

Don't pass invalid streams to Imaginary to avoid "empty" errors.

https://github.com/h2non/imaginary/blob/7efb66c243056e5b3b65215e101be7915983e364/error.go#L19

GuzzleHttp\Exception\ClientException: Client error: `POST http://10.0.0.14:9000/pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22fit%22%2C%22params%22%3A%7B%22width%22%3A1024%2C%22height%22%3A1024%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22png%22%2C%22norotation%22%3A%22true%22%2C%22quality%22%3A%2280%22%7D%7D%5D` resulted in a `400 Bad Request` response: {"message":"Empty or unreadable image","status":400}

Checklist

@solracsf solracsf added this to the Nextcloud 28 milestone Oct 25, 2023
@solracsf solracsf closed this Oct 25, 2023
@solracsf solracsf reopened this Oct 25, 2023
@solracsf solracsf force-pushed the imaginaryInvalidStream branch from 5889a0d to 91f80a7 Compare October 25, 2023 18:07
Signed-off-by: Git'Fellow <[email protected]>

Update Imaginary.php

Signed-off-by: Git'Fellow <[email protected]>

Update Imaginary.php

Signed-off-by: Git'Fellow <[email protected]>
Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

I suppose it makes sense but did not test

@szaimen szaimen merged commit 4c8232f into master Oct 26, 2023
@szaimen szaimen deleted the imaginaryInvalidStream branch October 26, 2023 09:59
@solracsf
Copy link
Member Author

solracsf commented Oct 29, 2023

This will also fix things like:

"fclose(): supplied resource is not a valid stream resource in file '/lib/private/Preview/Imaginary.php' line 181"

@solracsf
Copy link
Member Author

/backport to stable27

@solracsf
Copy link
Member Author

/backport to stable26

@solracsf solracsf changed the title Don't pass invalid streams to Imaginary fix: don't pass invalid streams to Imaginary Oct 29, 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.

4 participants