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

进行 get_image_embedding_from_file 的时候,有些图片会遇到 image decode 的报错 #65

Closed
web3nomad opened this issue May 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@web3nomad
Copy link
Member

进行 get_image_embedding_from_file 的时候,有些图片会遇到 image decode 的报错
这个问题好像是 zune-jpeg 库报出来的,然后会 panic

这样线程就挂了,后续任务就会遇到 "failed to receive results: channel closed"


thread '<unnamed>' panicked at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zune-jpeg-0.4.11/src/worker.rs:411:13:
assertion `left == right` failed
  left: 6912
 right: 3456
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:72:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
             at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:297:5
   4: zune_jpeg::worker::upsample
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zune-jpeg-0.4.11/src/worker.rs:411:13
   5: zune_jpeg::mcu::<impl zune_jpeg::decoder::JpegDecoder<T>>::post_process
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zune-jpeg-0.4.11/src/mcu.rs:385:17
   6: zune_jpeg::mcu::<impl zune_jpeg::decoder::JpegDecoder<T>>::decode_mcu_ycbcr_baseline
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zune-jpeg-0.4.11/src/mcu.rs:199:13
   7: zune_jpeg::decoder::JpegDecoder<T>::decode_into
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zune-jpeg-0.4.11/src/decoder.rs:708:13
   8: <image::codecs::jpeg::decoder::JpegDecoder<R> as image::image::ImageDecoder>::read_image
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/codecs/jpeg/decoder.rs:88:9
   9: <image::codecs::jpeg::decoder::JpegDecoder<R> as image::image::ImageDecoder>::read_image_boxed
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/codecs/jpeg/decoder.rs:101:9
  10: <alloc::boxed::Box<T> as image::image::ImageDecoder>::read_image
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/image.rs:715:9
  11: image::image::decoder_to_vec
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/image.rs:602:5
  12: image::dynimage::decoder_to_image
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/dynimage.rs:1018:23
  13: image::dynimage::DynamicImage::from_decoder
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/dynimage.rs:188:9
  14: image::io::reader::Reader<R>::decode
             at /Users/xddotcom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/io/reader.rs:271:9
  15: ai::blip::load_image
             at /Users/xddotcom/workspace/muse/gendam/crates/ai/src/blip/mod.rs:161:15
  16: ai::blip::BLIP::get_caption::{{closure}}
@web3nomad web3nomad added the bug Something isn't working label May 11, 2024
@web3nomad
Copy link
Member Author

image-rs/image#2230
etemesi254/zune-image#184

zune-jpeg 修复了但是只发了个 0.5.0-rc,没更新 image 依赖的 0.4
这样只能把 image 从 0.25 降到 0.24.9 才行,我试了下 0.24.9 可以
只能暂时这样了。

@web3nomad web3nomad added this to the Public Alpha 0.3 milestone May 11, 2024
web3nomad added a commit that referenced this issue May 11, 2024
@web3nomad
Copy link
Member Author

就是 0.24 到 0.25 变化很大,0.24 不使用这个 zune-jpeg ,可能其他功能有点影响。
目前没有,先固定到 0.24。
后面需要 0.25 的功能的时候,再重新来解决这个问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants