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: avoid erroring out on corrupt image data #2524

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Jul 6, 2024

Fixes #2257
Fixes #2235

As an aside, we should consider switching from using getimagesizefromstring() to getimagesize() if we can -- it consumes far less memory in my testing (presumably since the entire image isn't loaded into a string in memory).

P.S. Technically this also addresses the logging side of #2259, but it's unclear whether that's arising from a memory limit or what. I can only get that error if I feed getimagesizefromstring() /dev/null. :-) However this PR does add logging of the path so it'll likely help work out that issue as well.

@joshtrichards joshtrichards added bug Something isn't working 3. to review Waiting for reviews labels Jul 6, 2024
@joshtrichards joshtrichards added this to the Nextcloud 30 milestone Jul 6, 2024
@joshtrichards
Copy link
Member Author

/backport to stable29

@backportbot backportbot bot added the backport-request Pending backport by the backport-bot label Jul 6, 2024
@joshtrichards
Copy link
Member Author

/backport to stable28

@artonge
Copy link
Collaborator

artonge commented Jul 8, 2024

As an aside, we should consider switching from using getimagesizefromstring() to getimagesize() if we can

I think to recall that getimagesize() would not work well with external storage. But maybe I am wrong.

@artonge artonge merged commit 4261fce into master Jul 8, 2024
45 checks passed
@artonge artonge deleted the fix-getimagesizefromstring-errors branch July 8, 2024 08:45
@backportbot backportbot bot removed the backport-request Pending backport by the backport-bot label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
2 participants