Make WordPress Core

Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#19931 closed enhancement (duplicate)

media.php image interlace filter

Reported by: bobbravo2's profile bobbravo2 Owned by: bobbravo2's profile bobbravo2
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Media Keywords:
Focuses: Cc:

Description

in wp-includes/media.php:448

imageinterlace($newimage, apply_filters('image_interlace',false);

See the pull request on github:
https://github.com/bobbravo2/WordPress/pull/new/patch-1?quick_pull=1

Attachments (1)

diff19931.diff (601 bytes) - added by bobbravo2 13 years ago.

Download all attachments as: .zip

Change History (18)

#1 @bobbravo2
13 years ago

  • Cc bobbravo2 added

#3 follow-up: @markjaquith
13 years ago

I think we should pass in $orig_type as a second parameter to the filter so that people can interlace only for certain image types.

Also, please space out your code a bit, like so:

imageinterlace( $newimage, apply_filters( 'image_interlace', false, $orig_type ) );

@bobbravo2
13 years ago

#4 in reply to: ↑ 3 @bobbravo2
13 years ago

Replying to markjaquith:

I think we should pass in $orig_type as a second parameter to the filter so that people can interlace only for certain image types.

Also, please space out your code a bit, like so:

imageinterlace( $newimage, apply_filters( 'image_interlace', false, $orig_type ) );


Done

#5 @bobbravo2
13 years ago

I can confirm that this filter works as intended for PNG, JPG, but NOT gif because "Underlying library (GD) does not support this feature."

To verify that the interlace bit has been set on JPG and PNG images, use ImageMagick

verify -verbose IMAGE_NAME.png/jpg

However, the filter does not cause any error on attempting to set the imageinterlace bit on a GIF

Last edited 13 years ago by bobbravo2 (previous) (diff)

#6 @bobbravo2
13 years ago

  • Keywords needs-testing removed

#7 follow-up: @nacin
13 years ago

Would it make sense to perhaps pass $newimage by reference to an action, then any number of functions could be run on it? Or would that give unnecessary control?

#8 in reply to: ↑ 7 @bobbravo2
13 years ago

Replying to nacin:

Would it make sense to perhaps pass $newimage by reference to an action, then any number of functions could be run on it? Or would that give unnecessary control?

I think that's not necessary, as I see this filter as being defined once by a theme that heavily uses WordPress image_resize function. I think it may give too much control.

#9 @bobbravo2
12 years ago

  • Owner set to bobbravo2
  • Status changed from new to accepted

#10 @bobbravo2
12 years ago

  • Keywords dev-feedback added; needs-docs removed

#11 @bobbravo2
12 years ago

  • Version changed from 3.3.1 to 3.4

#12 follow-up: @SergeyBiryukov
12 years ago

  • Version changed from 3.4 to 3.3.1

Version field indicates when the enhancement was initially suggested.

#13 in reply to: ↑ 12 @bobbravo2
12 years ago

Replying to SergeyBiryukov:

Version field indicates when the enhancement was initially suggested.

Thanks! I'm still learning my way around.

#14 @bobbravo2
12 years ago

Bump — any guidance on getting this added to the next release?

#16 @markoheijnen
11 years ago

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

Duplicate of #21668.

#17 @markoheijnen
11 years ago

  • Keywords has-patch dev-feedback removed
Note: See TracTickets for help on using tickets.