WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#19931 closed enhancement (duplicate)

media.php image interlace filter

Reported by: bobbravo2 Owned by: 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 3 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 @bobbravo23 years ago

  • Cc bobbravo2 added

comment:3 follow-up: @markjaquith3 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 ) );

@bobbravo23 years ago

comment:4 in reply to: ↑ 3 @bobbravo23 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

comment:5 @bobbravo23 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 3 years ago by bobbravo2 (previous) (diff)

comment:6 @bobbravo23 years ago

  • Keywords needs-testing removed

comment:7 follow-up: @nacin3 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?

comment:8 in reply to: ↑ 7 @bobbravo23 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.

comment:9 @bobbravo23 years ago

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

comment:10 @bobbravo23 years ago

  • Keywords dev-feedback added; needs-docs removed

comment:11 @bobbravo23 years ago

  • Version changed from 3.3.1 to 3.4

comment:12 follow-up: @SergeyBiryukov3 years ago

  • Version changed from 3.4 to 3.3.1

Version field indicates when the enhancement was initially suggested.

comment:13 in reply to: ↑ 12 @bobbravo23 years ago

Replying to SergeyBiryukov:

Version field indicates when the enhancement was initially suggested.

Thanks! I'm still learning my way around.

comment:14 @bobbravo23 years ago

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

comment:16 @markoheijnen2 years ago

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

Duplicate of #21668.

comment:17 @markoheijnen2 years ago

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