Opened 16 months ago

Closed 6 weeks ago

Last modified 6 weeks ago

#19931 closed enhancement (duplicate)

media.php image interlace filter

Reported by: bobbravo2 Owned by: bobbravo2
Priority: normal Milestone:
Component: Media Version: 3.3.1
Severity: normal Keywords:
Cc: bobbravo2

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 16 months ago.

Download all attachments as: .zip

Change History (18)

  • Cc bobbravo2 added

comment:3 follow-up: ↓ 4   markjaquith16 months 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 ) );

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

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
Version 0, edited 16 months ago by bobbravo2 (next)
  • Keywords needs-testing removed

comment:7 follow-up: ↓ 8   nacin15 months 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   bobbravo215 months 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.

  • Owner set to bobbravo2
  • Status changed from new to accepted
  • Keywords dev-feedback added; needs-docs removed
  • Version changed from 3.3.1 to 3.4
  • Version changed from 3.4 to 3.3.1

Version field indicates when the enhancement was initially suggested.

comment:13 in reply to: ↑ 12   bobbravo212 months ago

Replying to SergeyBiryukov:

Version field indicates when the enhancement was initially suggested.

Thanks! I'm still learning my way around.

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

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

Duplicate of #21668.

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