-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
202 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<!-- should transform to amp-anim--> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/200px-Rotating_earth_%28large%29.gif"> | ||
<img src="file:///tmp/cat_animation.gif" /> | ||
|
||
<!-- should transform to amp-img because this gif is not animated --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/b/bb/Quilt_design_as_46x46_uncompressed_GIF.gif"> | ||
<img src="file:///tmp/dog.gif" /> | ||
|
||
<!-- should transform to amp-anim--> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png"> | ||
<img src="file:///tmp/ball_animation.png" /> | ||
|
||
<!-- should transform to amp-img because this png is not animated --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Wikimedia-logo.png/240px-Wikimedia-logo.png"> | ||
<img src="file:///tmp/kitten.jpg" /> | ||
|
||
<!-- nonexistent image, should refuse to convert to amp-img and delete it --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/non-existent-image1234.jpg"> | ||
<img src="file:///tmp/nope.jpg" /> |
3 changes: 2 additions & 1 deletion
3
tests/test-data/fragment-html/img-anim-test-fragment.html.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"use_amp_anim_tag" : true, | ||
"remove_non_converted_img_tag" : true | ||
"remove_non_converted_img_tag" : true, | ||
"server_url": "file://" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
<!-- Note: this image is in the public domain. https://commons.wikimedia.org/wiki/File:"Birdcatcher"_with_jockey_up.jpg --> | ||
|
||
<!-- should transform to amp-img --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/%22Birdcatcher%22_with_jockey_up.jpg"> | ||
<img src="file:///tmp/kitten.jpg" /> | ||
|
||
<!-- should transform to amp-img with fixed layout, preserving the width and height --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/%22Birdcatcher%22_with_jockey_up.jpg" width="125" height="96"> | ||
<img src="file:///tmp/kitten.jpg" width="125" height="96" /> | ||
|
||
<!-- nonexistent image, should refuse to convert to amp-img and keep it as it is --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/non-existent-image1234.jpg"> | ||
<img src="file:///tmp/nope.jpg" /> | ||
|
||
<!-- should provide layout and height width and make layout responsive --> | ||
<amp-img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/%22Birdcatcher%22_with_jockey_up.jpg"></amp-img> | ||
<amp-img src="file:///tmp/kitten.jpg"></amp-img> | ||
|
||
<!-- since only width exists, overwrite with height and width from original image --> | ||
<amp-img layout="responsive" src="https://upload.wikimedia.org/wikipedia/commons/e/ee/%22Birdcatcher%22_with_jockey_up.jpg" width="500"></amp-img> | ||
<amp-img layout="responsive" src="file:///tmp/kitten.jpg" width="200"></amp-img> | ||
|
||
<!-- since height is illegal, overwrite with height and width from original image --> | ||
<amp-img layout="responsive" src="https://upload.wikimedia.org/wikipedia/commons/e/ee/%22Birdcatcher%22_with_jockey_up.jpg" width="625" height="auto"></amp-img> | ||
<amp-img layout="responsive" src="file:///tmp/kitten.jpg" width="200" height="auto"></amp-img> | ||
|
||
<!-- since units are inconsistent, overwrite with height+width from original image --> | ||
<amp-img layout="responsive" src="https://upload.wikimedia.org/wikipedia/commons/e/ee/%22Birdcatcher%22_with_jockey_up.jpg" width="625rem" height="480"></amp-img> | ||
<amp-img layout="responsive" src="file:///tmp/kitten.jpg" width="200rem" height="100"></amp-img> | ||
|
||
<!-- should transform to amp-pixel --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif"> | ||
<img src="file:///tmp/pixel.gif" /> | ||
|
||
<!-- should transform to amp-img instead of amp-anim because of default option['use_amp_anim_tag'] = false --> | ||
<img src="https://upload.wikimedia.org/wikipedia/commons/b/bb/Quilt_design_as_46x46_uncompressed_GIF.gif"> | ||
<img src="file:///tmp/cat_animation.gif" /> |
3 changes: 2 additions & 1 deletion
3
tests/test-data/fragment-html/img-test-fragment.html.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"img_max_fixed_layout_width" : 200 | ||
"img_max_fixed_layout_width" : 200, | ||
"server_url": "file://" | ||
} |
Oops, something went wrong.