[wp-trac] [WordPress Trac] #57276: Failing TIFF image uploads to S3 buckets using WP Offload Plugin

WordPress Trac noreply at wordpress.org
Mon Dec 5 14:26:28 UTC 2022


#57276: Failing TIFF image uploads to S3 buckets using WP Offload Plugin
--------------------------+-----------------------------
 Reporter:  jsaravana     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  6.1.1
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 For TIFF image upload, it's failing to offload media to third party WP
 Offload Media plugin.
 It is failing because we introduced filesize metadata for images doesn't
 have thumbnail images https://core.trac.wordpress.org/changeset/52837 .
 which is telling the wp_generate_attachment_metadata hook that there are
 image thumbnail. but no other sizes available.
 Here is the bug I created for WP Offload Media plugin and their response.
 I see they have valid point. https://github.com/deliciousbrains/wp-
 amazon-s3-and-cloudfront/issues/616#issuecomment-1337245283
 we should be checking if the meta data set only, we need to pass Filesizes
 with meta data.

 I think it will fix the issue by checking if metadata is not empty to set
 filesizes

 From
 {{{#!php
 <?php
         // Capture file size for cases where it has not been captured yet,
 such as PDFs.
         if ( ! isset( $metadata['filesize'] ) && file_exists( $file ) ) {
                 $metadata['filesize'] = wp_filesize( $file );
         }
 }}}


 To this
 {{{#!php
 <?php
         // Capture file size for cases where it has not been captured yet,
 such as PDFs.
         if ( $metadata && ! isset( $metadata['filesize'] ) && file_exists(
 $file ) ) {
                 $metadata['filesize'] = wp_filesize( $file );
         }

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57276>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list