Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#57276 new defect (bug)

Failing TIFF image uploads to S3 buckets using WP Offload Plugin

Reported by: jsaravana's profile jsaravana Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 6.1.1
Component: Media Keywords: has-patch
Focuses: Cc:

Description

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
        // 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
        // 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 );
        }

Change History (1)

This ticket was mentioned in PR #3727 on WordPress/wordpress-develop by jeysaravana.


20 months ago
#1

  • Keywords has-patch added

Added metadata empty check condition for wp_generate_attachment_metadata function

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 metadata set only, we need to pass Filesizes with meta data.

Trac ticket: https://core.trac.wordpress.org/ticket/57276

Note: See TracTickets for help on using tickets.