Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#24459 closed defect (bug) (fixed)

Editing images with GD breaks with streams

Reported by: rmccue's profile rmccue Owned by: ryan's profile ryan
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch reporter-feedback
Focuses: Cc:

Description

See #18543 for the original ticket when support for this was added.

Unfortunately, when this was committed, it was inadvertently broken. Although the $filename parameter is set to null, this is never used, and instead $arguments is passed to the GD functions. GD then receives a stream URL, and breaks completely.

Instead, $arguments[1] should be set to null in WP_Image_Editor::make_image() if the URL is a stream.

Attachments (4)

24459.diff (414 bytes) - added by rmccue 12 years ago.
24459.2.diff (873 bytes) - added by markoheijnen 11 years ago.
24459.3.diff (1.0 KB) - added by nacin 11 years ago.
24459.4.diff (1.8 KB) - added by markoheijnen 11 years ago.

Download all attachments as: .zip

Change History (15)

@rmccue
12 years ago

#1 @rmccue
12 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.6

#3 @nacin
11 years ago

markoheijnen, DH-Shredder?

#4 @rmccue
11 years ago

For reference, you can reproduce via App Engine, disabling the workaround code in there (line 508).

#5 @markoheijnen
11 years ago

The patch looks fine to me. Did remove the $dst_file variable in my patch since that isn't needed anymore.

@nacin
11 years ago

#6 @markoheijnen
11 years ago

Added a new patch that moves this logic to the GD editor. We can check if arguments[1] is set and then unset it but you never know what other implementation someone has. With previous patches imagick will fatal error since it would send 2 arguments instead of only 1.

I did some basic tests but not yet with streams. My laptop is crashing randomly.

#7 @markoheijnen
11 years ago

  • Keywords reporter-feedback added

Ryan, can you test out the latest patch?

#8 @nacin
11 years ago

24459.4.diff seems to make sense to me.

#9 @aaroncampbell
11 years ago

I tested 24459.4.diff and it seems to work for me.

Last edited 11 years ago by aaroncampbell (previous) (diff)

#10 @ryan
11 years ago

I tested editing images and creating headers (from uploads and from library) on wordpress.com with local and replicated files. Seems fine, looks good.

#11 @ryan
11 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In 24727:

Fix editing images with GD when using streams.

Props rmccue, markoheijnen, nacin
fixes #24459

Note: See TracTickets for help on using tickets.