Skip to content

Commit 9539d0c

Browse files
authored
Don't process pngs with VI snippets (#26)
1 parent 4434828 commit 9539d0c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sphinxext/photofinish/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def visit_image(
209209

210210
with Image.open(img_src_path) as im:
211211
im_width, im_height = im.size
212+
vi_snippet_data = get_vi_snippet_data(im)
212213

213214
# Set image ratio. Browsers need the aspect ratio of the image for
214215
# non-janky lazyloading. We can either give it the aspect ratio
@@ -225,6 +226,11 @@ def visit_image(
225226
]
226227

227228
for dest_ext in dest_exts:
229+
230+
if img_ext == ".png" and dest_ext != ".png":
231+
if vi_snippet_data:
232+
continue
233+
228234
srcset_srcs = []
229235
width_min = app.config.width_min
230236
width_max = 2 * app.config.max_viewport_width

0 commit comments

Comments
 (0)