File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -538,7 +538,11 @@ fn file_hash(src: &Path) -> Result<blake3::Hash> {
538
538
fn image_metadata ( file : & std:: fs:: File ) -> Result < ( u64 , Option < exif:: Exif > ) > {
539
539
let len = file. metadata ( ) ?. len ( ) ;
540
540
let mut bufreader = std:: io:: BufReader :: new ( file) ;
541
- let exif = exif:: Reader :: new ( ) . read_from_container ( & mut bufreader) . ok ( ) ;
541
+ let exif = exif:: Reader :: new ( )
542
+ . continue_on_error ( true )
543
+ . read_from_container ( & mut bufreader)
544
+ . or_else ( |e| e. distill_partial_result ( |_errors| { } ) )
545
+ . ok ( ) ;
542
546
Ok ( ( len, exif) )
543
547
}
544
548
Original file line number Diff line number Diff line change @@ -258,6 +258,8 @@ async fn test_selfavatar_copy_without_recode() {
258
258
259
259
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
260
260
async fn test_recode_image_1 ( ) {
261
+ // `exiftool` reports for this file "Bad offset for IFD0 XResolution", still Exif must be
262
+ // detected and removed.
261
263
let bytes = include_bytes ! ( "../../test-data/image/avatar1000x1000.jpg" ) ;
262
264
SendImageCheckMediaquality {
263
265
viewtype : Viewtype :: Image ,
@@ -418,7 +420,7 @@ async fn test_recode_image_balanced_png() {
418
420
419
421
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
420
422
async fn test_sticker_with_exif ( ) {
421
- let bytes = include_bytes ! ( "../../test-data/image/logo.png" ) ;
423
+ let bytes = include_bytes ! ( "../../test-data/image/logo-exif .png" ) ;
422
424
SendImageCheckMediaquality {
423
425
viewtype : Viewtype :: Sticker ,
424
426
bytes,
You can’t perform that action at this time.
0 commit comments