WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 7 months ago

#25490 closed defect (bug) (duplicate)

Issue with large images in Media Libray

Reported by: wpweaver Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6.1
Component: Media Keywords:
Focuses: Cc:

Description

Images in the media library are apparently limited to a maximum of 8192px width/height. This manifests as a PHP problem when using:

$metadata = wp_get_attachment_metadata();
$w = $metadata [ 'width' ];
$h = $metadata[ 'height' ];

as used by many themes (including Twenty Thirteen at least) to display Attachment pages. The resulting run-time errors (using twenty-thirteen):

Warning: Illegal string offset 'width' in /wp-content/themes/twentythirteen/image.php on line 40
Warning: Illegal string offset 'height' in /wp-content/themes/twentythirteen/image.php on line 41

This was with a 9,000px wide .jpg image (which loaded into the media library okay, but stopped with a "crunching" message on the upload page). The errors went away when the image was reduced to 8192px, so I'm assuming there is a limit of 8192 somewhere.

This manifests in 3.6.1, but I'd assume it is in 3.7 beta as well.

Change History (4)

comment:1 wpweaver7 months ago

Sorry - follow up:

Ideally the fix would allow large images (it was discovered by a user of my theme who was uploading high quality artistic images suitable for large size printing), but I think at least a warning of the limit is important.

comment:2 helen7 months ago

I don't think it's arbitrarily limited like that - this sounds like memory ran out before attachment metadata was generated and saved.

comment:3 markoheijnen7 months ago

This is not a limit in WordPress but has to due with the memory. It's hard and maybe impossible to check if we can upload and give a better error. Since we then will guess how much a pixel will cost in memory. I would say wontfix.

comment:4 helen7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #23127.

Note: See TracTickets for help on using tickets.