photoview / photoview

Photo gallery for self-hosted personal servers
https://photoview.github.io/
GNU Affero General Public License v3.0
5.67k stars 418 forks source link

invalid JPEG format: bad RST marker #1089

Open DaCHack opened 4 months ago

DaCHack commented 4 months ago

Describe the bug The following error occurred when I decoded Images from one specific Camera:

invalid JPEG format: bad RST marker

To Reproduce Steps to reproduce the behavior: Happy to share sample Images if needed, but issue seems to be explained and resolved for photoprism and Go before and might be taken over to photoview: https://github.com/photoprism/photoprism/issues/1673 https://github.com/golang/go/issues/40130

First 100 Bytes of the Test Image Look like:

0000000 d8ff c0ff 1100 0f08 14a0 03e0 2101 0200
0000010 0111 1103 ff01 00fe 470b 4550 636e 646f

Expected behavior Unclean JPG detected and error handled importing the Body of the Image data.

Screenshots Only Full error Text: 2024/10/05 02:13:02 ERROR: Error scanning media for album (629) file (/photos/Privat/PICT0311.jpg): process media database transaction: process media (/photos/Privat/PICT0311.jpg): could not create thumbnail cached image: invalid JPEG format: bad RST marker

Your environment: Feel free to remove and add what you think might be useful.

kkovaletp commented 4 months ago

@DaCHack, thanks for the report. We have several similar issues in the product. To address all of them at once, we plan to pass all the image processing to the external worker (ImageMagick): #996

@googollee, do you see an urgent need in an intermediate solution until the #996 is not implemented? If not, I'd put this ticket as a sub-task for the #996, so that we could check that such images are handled correctly once the feature is ready

googollee commented 4 months ago

I have some questions about this. I'll comment in #996.

googollee commented 1 month ago

This issue is from go library. I plan to use magick to convert jpgs, instead of go library.