[wp-hackers] [WordPress Trac] #19695: Links widget does not generate width or height attributes when showing an image

Eric Mann eric at eam.me
Fri Dec 30 17:33:21 UTC 2011

GD isn't a requirement, but this is the same way we handle it elsewhere.
 And, coming from having accidentally installed PHP at least once *without* GD,
I can tell you that having notices like this in there is a lifesaver.  It
took me about 2 weeks to figure out why thumbnails weren't being

I mirrored my patch after the other patterns we follow when using
{{{getimagesize()}}} in core for consistency.  If one of the core leads
wants to step in with an opinion, I'd be fine going either way, really.

On Fri, Dec 30, 2011 at 9:29 AM, WordPress Trac <
wp-trac at lists.automattic.com> wrote:

> #19695: Links widget does not generate width or height attributes when
> showing an
> image
> ------------------------------------------------+--------------------------
>  Reporter:  mbijon                              |       Owner:
>     Type:  defect (bug)                        |      Status:  new
>  Priority:  normal                              |   Milestone:  Awaiting
> Component:  Widgets                             |  Review
>  Severity:  normal                              |     Version:  3.3
>  Keywords:  dev-feedback 2nd-opinion has-patch  |  Resolution:
> ------------------------------------------------+--------------------------
> Comment (by mbijon):
>  Thanks Eric. Per your Twitter reference to {{{/wp-includes/media.php}}},
>  that's what I started from. My main change is using the 4th value returned
>  by {{{getimagesize()}}} instead of building a string.
>  I'm not sure about throwing an error if GD Lib isn't installed (in
>  attachment:ticket:19695:19695.3.diff). I don't like doing that because GD
>  isn't a requirement for installing WP,
>  http://wordpress.org/about/requirements/. My method failed past that on
>  purpose.
>  Note that PHP downgraded {{{getimagesize()}}} read errors to E_NOTICE in
>  5.2. I think that's the right approach, and that delivering content
>  instead of an error msg is more important than having correctly-set image
>  attributes.
> --
> Ticket URL: <http://core.trac.wordpress.org/ticket/19695#comment:4>
> WordPress Trac <http://core.trac.wordpress.org/>
> WordPress blogging software

More information about the wp-hackers mailing list