realoksi / foobar2000-catbox

With a fork of the Discord Rich Presence Integration component, uploads cover art to https://catbox.moe/ and prints the URL
8 stars 1 forks source link

thread 'main' panicked at /home/realoksi/.cargo/... #13

Open afgks opened 2 months ago

afgks commented 2 months ago

Hello, after I started using your latest builds with TheQwertiest's new builds, there are a few images that won't upload. This is one of the examples:

00 - Cover

Here is the error message:

Opening track for playback: "F:\Music\Game OST\Ridge Racer\[1998] Ridge Racer Remix Collision\02 - Rare Hero (Smartness Alien Mix).mp3"
foo_discord_rich:
Error:
Uploader failed with error code 101
  stdout:

  stderr:
thread 'main' panicked at /home/realoksi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zune-jpeg-0.4.11/src/worker.rs:411:13:
assertion `left == right` failed
  left: 9728
 right: 4864
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
realoksi commented 2 months ago

I can only barely understand what's happening around the assertion, but it seems to be something to do with the blue channel of this particular image that is causing this to happen? Specifically, the dependency causing it is zune-jpeg, which is used to decode the image. I also see the JPG itself has a comment that references what looks like some obscure old image editing software called HYPERKiD, so that might be contributing to the issue.

Anyway, currently the image crate depends on a minimum of zune-jpeg version 0.4.11. This version is automatically used when the application is compiled. Manually adding the latest version of zune-jpeg (version 0.4.13) to the Cargo.toml and compiling with it instead seems to solve the issue for me when then testing by directly feeding it the image and by using as intended via fb2k.

I've uploaded a pre-release for testing. Please try it out with this and your other images. I'll wait for confirmation (hopefully, that it works) before closing the issue and creating a normal release.

afgks commented 2 months ago

Hello, it seems that this particular error has been fixed, which is great :) Unfortunately, it didn't fix the issue for the other images. I found 6 images in my collection that wouldn't upload, but also wouldn't output any error in the console. It doesn't seem to relate to the file size issue that I have previously reported, as there are very large images in my collection that can be uploaded without any problem.

cover cover (2) cover (2) cover Folder Martin Stig Andersen - Limbo (Original Videogame Soundtrack) - cover