[wp-trac] [WordPress Trac] #55786: Thickbox gallery does not recognize webp images

WordPress Trac noreply at wordpress.org
Sat May 21 18:52:53 UTC 2022


#55786: Thickbox gallery does not recognize webp images
----------------------------------------+------------------------------
 Reporter:  ilunabar                    |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  External Libraries          |     Version:  5.9.3
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  javascript
----------------------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:  has-patch => needs-patch good-first-bug
 * component:  General => External Libraries


Old description:

> -- The line of code 79 of /wp-includes/js/thickboxthickbox.js is:
>
> var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
>

> -- It should be something like this:
>
> var urlString = /\.webp|\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
>

> -----------------
>

> The line of code 82 of /wp-includes/js/thickboxthickbox.js is:
>
> if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' ||
> urlType == '.gif' || urlType == '.bmp'){//code to show images
>

> -- It should be something like this:
>
> if(urlType == '.webp' || urlType == '.jpg' || urlType == '.jpeg' ||
> urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to
> show images
>

> I hope this will help.

New description:

 -- The line of code 79 of /wp-includes/js/thickbox/thickbox.js is:
 {{{
 var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
 }}}

 -- It should be something like this:
 {{{
 var urlString = /\.webp|\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
 }}}

 -----------------


 The line of code 82 of /wp-includes/js/thickbox/thickbox.js is:
 {{{
 if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType
 == '.gif' || urlType == '.bmp'){//code to show images
 }}}

 -- It should be something like this:
 {{{
 if(urlType == '.webp' || urlType == '.jpg' || urlType == '.jpeg' ||
 urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to
 show images
 }}}

 I hope this will help.

--

Comment:

 Hi and welcome to Trac! Thanks for the report.

 The patch will need to edit the
 [https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/vendor/thickbox/thickbox.js?rev=50410#L79
 thickbox.js file] in the `js/_enqueues` directory.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55786#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list