question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

storage-resize-images "Corrupt JPEG data" error when uploaded from some phones

See original GitHub issue

Extension name

This feature request is for extension: storage-resize-images

What feature would you like to see?

An extra level of configuration for ‘deletion of original file’ where the file is only deleted if the resize is successful and all new specified resizes are created.

How would you use it?

I am using the resizing extension as a compression tool so I can save space. However, some images that are uploaded from my users using the File API in a PWA from their phones are resulting in errors in the resizing function but the original image is still functional. In cases where the image resize results in an error, I would like to use the original file and store/use the resized images only when the resize function is successful.

Note: Current behavior

If the ‘deletion of original file’ option is selected, the original file is deleted regardless of whether or not the resize function was successful.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ryqndevcommented, Oct 6, 2020

I can’t seem to figure out what the pattern is with the errors since some images work and some don’t but I’m uploading images to my PWA using an html file input that only accepts images on my Google Pixel 4 XL. Uploading images from my computer works perfectly fine so I don’t think it’s an error in the code. I’m assuming some images formatted in Google Photos are kinda wonky?? Not really sure but I hope this helps.

These are the 2 types of errors I’m getting:

Error when resizing image [Error: VipsJpeg: Corrupt JPEG data: 18 extraneous bytes before marker 0xdb VipsJpeg: Corrupt JPEG data: 18 extraneous bytes before marker 0xdb VipsJpeg: Corrupt JPEG data: 18 extraneous bytes before marker 0xdb VipsJpeg: Corrupt JPEG data: 18 extraneous bytes before marker 0xdb VipsJpeg: Corrupt JPEG data: 18 extraneous bytes before marker 0xdb VipsJpeg: out of order read at line 0 VipsJpeg: out of order read at line 0 ]

Error when resizing image [Error: VipsJpeg: out of order read at line 0 ]

Let me know if you need any more info!

1reaction
jhuleattcommented, Nov 16, 2020

@mikemey01 thanks for filing this with Sharp!

Unfortunately, since, per https://github.com/lovell/sharp/issues/2416, this was caused by an actual malformed JPEG file, and Sharp recommended we only turn on failOnError if we “trust the source of the images” (which we shouldn’t given that most uses of this extension probably involve uploads from end-users), I think we’re just going to have to call this “working as intended” and close this one out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get "Corrupt JPEG data" message when using ...
jpg', it works just fine. Why do I get "Corrupt JPEG data" message when using imagecreatefromjpeg() function in php? php · file-upload.
Read more >
Fix Photoshop Problem Parsing the JPEG Data
Solve the problem parsing JPEG data in Adobe Photoshop with the help of photo repair software that helps fix corrupted images with easy...
Read more >
some jpegs don't work - Corrupt JPEG data [#455898] - Drupal
I only have problems with JPEGs that were taken with my cell phone camera. After uploading the JPEG and cropping, I receive the...
Read more >
How to solve problem parsing the JPEG data in Photoshop
Methods to fix Photoshop JPEG parsing error · Open the JPEG file in the Windows default picture viewer · Rotate the image by...
Read more >
Fix Unable to Open JPEG Image - Unsupported File on ...
Learn how you can fix unable to open JPEG image on Android phone with error unsupported file message.FOLLOW US ON TWITTER: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found