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

Test if a file is a valid jpg file #3778

Merged
merged 1 commit into from Mar 10, 2017
Merged

Test if a file is a valid jpg file #3778

merged 1 commit into from Mar 10, 2017

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Mar 8, 2017

During preview generation if we provide an invalid JPG file the system
errors out with a PHP Fatal Error. Now we can't catch Fatal Errors (in
5.6). I suspect that exif_imagetype to fall back to the extention.

However a valid jpg file has a size. So we request the size of the image
and just drop out if that returns false.

During preview generation if we provide an invalid JPG file the system
errors out with a PHP Fatal Error. Now we can't catch Fatal Errors (in
5.6). I suspect that exif_imagetype to fall back to the extention.

However a valid jpg file has a size. So we request the size of the image
and just drop out if that returns false.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer added 3. to review Waiting for reviews bug labels Mar 8, 2017
@rullzer rullzer added this to the Nextcloud 12.0 milestone Mar 8, 2017
Copy link
Member

@oparoz oparoz left a comment

Choose a reason for hiding this comment

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

Smart workaround 👍

Copy link
Member

@LukasReschke LukasReschke left a comment

Choose a reason for hiding this comment

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

🙈 🙊 🙉 😉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants