You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to resize an image based on height and width.
If I use thumbnail (only using width) it works as intended, using thumbnail_with_opts it does not.
Note that I have moved the App into the function to be able to access the error buffer.
fnmanipulate_image(path:&str,height:i32,width:i32,quality:u32) -> Result<(),()>{let libvips = VipsApp::new("app",true).expect("Could not start libvips");
libvips.concurrency_set(2);// TODO: Error handlinglet thumb_opts = ops::ThumbnailOptions{height: height,
..ops::ThumbnailOptions::default()};
log::info!("{}", path);// This works// let image = ops::thumbnail(&path, width).unwrap();// This doesn'tlet image:VipsImage = match ops::thumbnail_with_opts(path, width,&thumb_opts){Err(err) => {
log::error!("{}", err);
log::error!("{}", libvips.error_buffer().unwrap());returnErr(());}Ok(img) => img,};
image.image_write_to_file("uploads/temp.jpg").unwrap();returnOk(());}
I do get the following error (the path from above does exist)
vips error: ThumbnailError. Check error buffer for more details
vips__file_read: error reading from file ""
profile_load: unable to load profile ""
vips__file_read: error reading from file ""
profile_load: unable to load profile ""
vips_threadset_free: peak of 0 threads
memory: high-water mark 1.35 MB
error buffer: vips__file_read: error reading from file ""
profile_load: unable to load profile ""
vips__file_read: error reading from file ""
profile_load: unable to load profile ""
Am I doing something wrong? If so please tell me what the correct way is.
The text was updated successfully, but these errors were encountered:
I'm trying to resize an image based on height and width.
If I use
thumbnail
(only using width) it works as intended, usingthumbnail_with_opts
it does not.Note that I have moved the App into the function to be able to access the error buffer.
I do get the following error (the path from above does exist)
Am I doing something wrong? If so please tell me what the correct way is.
The text was updated successfully, but these errors were encountered: