Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-background doesn't support webp image format #3200

Closed
greendinosaur opened this issue Apr 24, 2022 · 2 comments
Closed

data-background doesn't support webp image format #3200

greendinosaur opened this issue Apr 24, 2022 · 2 comments

Comments

@greendinosaur
Copy link

I've been resizing some images to use the webp format and I noticed that data-background does not support webp format. Is there a reason for this?

I took a look at the revealjs code and the code to render the background restricts the image types passed into the data-background attribute and webp isn't included in the list. I'm happy to make the code change to support webp and do a pull request, just wanted to check if there was a reason it's not supported.

https://developers.google.com/speed/webp/ has more info on this image format.

@hakimel
Copy link
Owner

hakimel commented Apr 25, 2022

I've made the data-background image detection work for webp now too. Turns out this only affected webp images loaded locally via data-background.

These already worked:
<section data-background="https://www.gstatic.com/webp/gallery/1.webp"></section>
<section data-background-image="1.webp"></section>

This did not work before:
<section data-background="1.webp"></section>

@hakimel hakimel closed this as completed Apr 25, 2022
samwize pushed a commit to samwize/reveal.js that referenced this issue Jun 9, 2022
* hakimel/master: (1422 commits)
  tweak slides mention
  fix issues with overflowing fit-text when exporting to pdf hakimel#3191 hakimel#3120
  Fix typo in plugin.js
  notes plugin only listens for same-origin postmessages to prevent xss
  new attempt at speaker view xss fix
  add support for 'data-background-gradient' hakimel#2510
  fix issue where auto-animate did not work when jumping three or more slides (i.e. longer than the view distance)
  made data-background attribute work with .webp hakimel#3200
  fix: truncated long r-fit-text on pdf
  update link
  fix issue with hakimel#3182 when slide numbers are disabled
  fix inconsistent fragment visibility in looping presentations hakimel#3123
  fix: pdf page numbering for fragment group
  always use css transforms for presentation scaling (zoom has too many quirks even if it is slightly sharper on ldpi displays)
  update lock file
  4.3.1
  notes plugin allows messsages from current/upcoming slide windows
  fix hakimel#3154
  fix vertical slide link in demo hakimel#3155
  dont run full build + tests for package task hakimel#3156
  ...
@greendinosaur
Copy link
Author

greendinosaur commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@hakimel @greendinosaur and others