Skip to content

Decoding Error occurs when supplying a cropped image from client using CropperJS #2250

Answered by ChanManChan
ChanManChan asked this question in Q&A
Discussion options

You must be logged in to vote

it started working when I added this extra code

  let original_img = match image::open(&disk_path) {
            Ok(dyn_image) => dyn_image,
            Err(_) => Reader::new(Cursor::new(file_data))
                .with_guessed_format()
                .unwrap()
                .decode()
                .unwrap(),
        };

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChanManChan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant