[repo] Format, clippy clean, FORMATS.md, the full crate table in DEPENDENCIES.md
This commit is contained in:
@@ -25,7 +25,10 @@ fn reorder_rotate_delete_and_insert_blank() {
|
||||
assert_eq!(sizes[2], (842.0, 595.0), "page 1 was not turned");
|
||||
// Deleted pages are gone from the file, not just from the page list.
|
||||
for blob in scan_objects(&out) {
|
||||
assert!(!contains(&blob, "Doc page 2") && !contains(&blob, "Doc page 3"), "a deleted page survived in the file");
|
||||
assert!(
|
||||
!contains(&blob, "Doc page 2") && !contains(&blob, "Doc page 3"),
|
||||
"a deleted page survived in the file"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +123,12 @@ fn password_on_and_off() {
|
||||
#[test]
|
||||
fn images_to_pdf_and_back() {
|
||||
let mut jpeg = Vec::new();
|
||||
let photo = image::DynamicImage::ImageRgb8(image::RgbImage::from_fn(400, 300, |x, y| image::Rgb([x as u8, y as u8, 128])));
|
||||
let photo =
|
||||
image::DynamicImage::ImageRgb8(image::RgbImage::from_fn(400, 300, |x, y| image::Rgb([x as u8, y as u8, 128])));
|
||||
photo.write_to(&mut std::io::Cursor::new(&mut jpeg), image::ImageFormat::Jpeg).unwrap();
|
||||
let logo = image::DynamicImage::ImageRgba8(image::RgbaImage::from_fn(100, 200, |x, _| image::Rgba([255, 0, 0, if x < 50 { 255 } else { 0 }])));
|
||||
let logo = image::DynamicImage::ImageRgba8(image::RgbaImage::from_fn(100, 200, |x, _| {
|
||||
image::Rgba([255, 0, 0, if x < 50 { 255 } else { 0 }])
|
||||
}));
|
||||
let mut png = Vec::new();
|
||||
logo.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap();
|
||||
let pdf = pictor_pdf::images_to_pdf(&[(jpeg.clone(), photo.clone()), (png, logo)], PageFit::A4, 36.0).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user