Skip to content

First two bytes are not an SOI marker error #413

@sparalic

Description

@sparalic

Hi @Enet4 ,
I am new to Rust (from python) and was just trying to do some basic image loading tasks with this library. However, I keep getting the above error, I did try your sample code from the dicom-rs documentation. But I am not sure, can you please let me know what I am missing?

use dicom::object::open_file;
use dicom_pixeldata::PixelDecoder;

fn main() {

    let path = "../0003.dcm";
    let _obj = open_file(&path).unwrap();
    let data = _obj.decode_pixel_data().unwrap();

    println!("{:?}", data)
}

Error:

Finished dev [unoptimized + debuginfo] target(s) in 0.36s
Running `target/debug/dicom_testing`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(DecodePixelData { source: Custom { message: "JPEG decoder failure", source: Some(Format("first two bytes are not an SOI marker")) } })', src/main.rs:24:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libArea: libraryC-pixeldataCrate: dicom-pixeldataC-transfer-syntaxCrate: dicom-transfer-syntax-registrybugThis is a bugjpegSupport for the JPEG family of transfer syntaxes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions