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

Bug: (invalid JPEG format: bad RST marker) #1673

Closed
mbelletti opened this issue Oct 26, 2021 · 22 comments
Closed

Bug: (invalid JPEG format: bad RST marker) #1673

mbelletti opened this issue Oct 26, 2021 · 22 comments
Assignees
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release

Comments

@mbelletti
Copy link

What does not work as expected?

Many photos from iphone XSMax perfectly visibles on my mac, and on other devices, when imported in photoprism, gave this error:

index: failed creating thumbnails for IMG_xyzw.jpeg (invalid JPEG format: bad RST marker)

I've Library-> Hidden full of them and not visible at all.

I attach a photo as sample

IMG_2515

@mbelletti mbelletti added the bug Something isn't working label Oct 26, 2021
@lastzero
Copy link
Member

lastzero commented Oct 26, 2021

see golang/go#40130 and golang/go#41875

@lastzero lastzero self-assigned this Oct 26, 2021
@lastzero
Copy link
Member

Looks like we need to patch Go for this 🍿

@mbelletti
Copy link
Author

I see.
I've also a lot of:

`Missing 0xff00 Sequence'

It's the same bug?

Thank you

@lastzero
Copy link
Member

Most likely unless only few files are affected. They might have other issues then or are really broken.

@lastzero
Copy link
Member

https://twitter.com/lastzero/status/1452959588815413251

@lastzero lastzero added in-progress Somebody is working on this waiting Impediment / blocked / waiting and removed in-progress Somebody is working on this labels Oct 27, 2021
@lastzero
Copy link
Member

Waiting for this issue to be fixed in Go. If it takes more than 2 months, we'll have to release our own Go distribution. Remind me!

@mumbledenoise
Copy link

Waiting for this issue to be fixed in Go. If it takes more than 2 months, we'll have to release our own Go distribution. Remind me!

It has been 2 months, here's your reminder! :)

@lastzero
Copy link
Member

@mumbledenoise
Copy link

See:

* [image/jpeg: skip consecutive 0xff bytes golang/go#41875 (comment)](https://github.com/golang/go/pull/41875#issuecomment-995181753)

The code change seems minimal, I'm shocked they haven't merged it yet. Perhaps you'll need to follow their process and submit your own PR to get this pushed through?

golang/go#41875 (comment)

@lastzero
Copy link
Member

lastzero commented Jan 7, 2022

Tests are missing and you need to get familiar with the Google internal tools, which we currently don't have time for as we're drowning in work. Help welcome!

@lastzero lastzero added the help wanted Well suited for external contributors! label Jan 7, 2022
@moosepants
Copy link

FYI I took a look at the linked golang issue.
Created a test using the attached image which failed as described (bad RST). Thought it was job done...
The submitted code fix (skip consecutive 0xff bytes) did not resolve the issue 😒
It looks like the image has some minor corruption (i.e. extra bytes or missing bytes) and the golang jpeg processor is somewhat (surprisingly?) rudimentary in how it handles this.
I'm going to look into it a bit deeper (the libjpeg code has a good solution) but it may require more rework than I am prepared to put in (as a first time contributor).

As an aside, if there's an example image for the Missing 0xff00 Sequence issue I'd be interested to look at that whilst I have the golang src/build environment set up and my head is in the jpeg decoder. That may be solved by the linked fix 🤞

@moosepants
Copy link

@lastzero In case you didn't notice, I submitted a PR on golang that solves the issue for at least the attached test image (and possibly others).

https://go-review.googlesource.com/c/go/+/382754/

@lastzero
Copy link
Member

lastzero commented Feb 4, 2022

@moosepants Thanks! Much appreciated as I am literally drowning in work 😵‍💫

@mbelletti
Copy link
Author

I've found that all my images with Missing 0xff00 Sequence have some glitch.

As the image attached.

IMG_2085

@lastzero
Copy link
Member

lastzero commented Jun 2, 2022

@moosepants From what I can see, a review has been performed and some minor changes have been requested?
👉 https://go-review.googlesource.com/c/go/+/382754/

@moosepants
Copy link

moosepants commented Jun 2, 2022 via email

@lastzero
Copy link
Member

lastzero commented Nov 1, 2022

Failed on (x/tools) linux-amd64: https://storage.googleapis.com/go-build-log/0b8005c5/linux-amd64_a29c2471.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.

lastzero added a commit that referenced this issue Feb 21, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added enhancement Refactoring, improvement or maintenance task and removed bug Something isn't working labels Feb 21, 2023
@lastzero
Copy link
Member

lastzero commented Feb 21, 2023

Since we now have a workaround, the priority of this issue has been changed from bug to enhancement.

Screenshot 2023-02-21 at 17 36 08

lastzero added a commit that referenced this issue Feb 21, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Member

@mbelletti With the last commit, both images work for me! New preview build is available for testing soon. Let us know if you find any JPEGs that don't work yet so we can look into it.

@mbelletti
Copy link
Author

@lastzero Thank you. I will do

@lastzero
Copy link
Member

@mbelletti
Copy link
Author

I uploaded a jpg with a glitch that before gave errors (with Missing 0xff00 Sequence ), now is imported.
Thank you

https://demo.photoprism.app/library/albums/arqh3al2v8t3risn/view

@lastzero lastzero added tested Changes have been tested successfully and removed help wanted Well suited for external contributors! waiting Impediment / blocked / waiting labels Feb 22, 2023
seeschloss pushed a commit to seeschloss/photoprism that referenced this issue Apr 10, 2023
@graciousgrey graciousgrey added released Available in the stable release and removed tested Changes have been tested successfully labels May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

5 participants