搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Picture element displays no image if type="image/webp" entry is present.

  • 8 个回答
  • 6 人有此问题
  • 11 次查看
  • 最后回复者为 RSteinwand

more options

I'm running the latest beta.

The jpg in a picture element will not display if there's also an entry containing type="image/webp".

Example: http://googlechrome.github.io/samples/picture-element/ (2nd image, butterfly)

Another example (my site): http://www.intercepteft.com/solutions/property_management.html

webP image displays properly in Chrome, jpg appears properly in any browser except FF beta.

I'm running the latest beta. The jpg in a picture element will not display if there's also an entry containing type="image/webp". Example: http://googlechrome.github.io/samples/picture-element/ (2nd image, butterfly) Another example (my site): http://www.intercepteft.com/solutions/property_management.html webP image displays properly in Chrome, jpg appears properly in any browser except FF beta.

所有回复 (8)

more options

Did you enable the picture element and have set the dom.image.* prefs to true?

  • dom.image.picture.enabled
  • dom.image.srcset.enabled

With both of these set to true I'm not getting the image.

more options

Thanks.

I suspect I have both those set since I was playing with srcset before picture. Picture allows me to use jpg and webP images, which is why I decided that was the best fit for me, despite later implementation.

I noticed from Fiddler2 (a packet sniffer), FF beta was downloading the webP image, but unable to display anything except the text from the alt tag. So apparently it's not checking for valid image types it can display and instead just using the media tags. So I'm still calling this a bug.

BTW, this does work properly if media tags are used, but for simple images where just the type differs is where the problem lies. The slider at the top of our home page has 3 sizes of jpg and 3 webp images and works nicely. http://www.intercepteft.com

I also noticed a difference in the Chrome vs Firefox implementation and prefer Chrome. If you resize the browser with Chrome, it'll grab the proper image on the fly. Firefox OTOH, needs a page reload to get the proper image for the page width, not a problem when going from wide to narrow, but going from narrow to wide could result in a low resolution image.

由RSteinwand于修改

more options

Sorry, I was mistaken. My home page only works because I removed the webP portion.

I had hoped I could add a work-around by adding media tags with a really low width (like min-width:300px), but no go.

So how do we officially bug this?

BTW, if srcset is disabled in config and picture is enabled, I do get an image, but it's only the fail-over image. Nothing else works in FF if webP images are used.

由RSteinwand于修改

more options

This looks like bug 1045532 -- Type selection doesn't currently work, but should before picture is enabled by default.

more options

Thanks John.

Saves me from having to do more.

more options

I see this was fixed over a week ago, but I still can't view an image containing type=webP in latest Aurora if srcset is enabled.

I hate to ask for an ETA, but how long does it take for changes to make into mainstream? Do I have to install a nightly build?

more options

This fix only landed on mozilla-central (see comment 12), so only the Nightly 36.0a1 builds have it so far.