| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -137,7 +137,7 @@ import collection.JavaConverters._ | |||
| 137 | 137 | ||
| 138 | 138 | And("I should see the image url") | |
| 139 | 139 | el("[itemprop='associatedMedia image'] [itemprop=url]").attribute("content") should | |
| 140 | - include("/img/static/sys-images/Guardian/Pix/pictures/2012/8/6/1344274684805/Gunnerside-village-Swaled-009.jpg?width=700&q=55&auto=format&usm=12&fit=max&s=") | ||
| 140 | + include("/img/static/sys-images/Guardian/Pix/pictures/2012/8/6/1344274684805/Gunnerside-village-Swaled-009.jpg?width=700&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 141 | 141 | ||
| 142 | 142 | And("I should see the image width") | |
| 143 | 143 | el("[itemprop='associatedMedia image'] [itemprop=width]").attribute("content") should be("460") | |
@@ -405,7 +405,7 @@ import collection.JavaConverters._ | |||
| 405 | 405 | ||
| 406 | 406 | And("video meta thumbnailUrl should be set") | |
| 407 | 407 | $("[itemprop='associatedMedia video'] [itemprop=thumbnailUrl]").attribute("content") should | |
| 408 | - include("img/static/sys-images/Guardian/Pix/audio/video/2014/5/16/1400240928538/Nigel-Farage-LBC-debate-i-014.jpg?width=640&height=360&q=55&auto=format&usm=12&fit=max&s=") | ||
| 408 | + include("img/static/sys-images/Guardian/Pix/audio/video/2014/5/16/1400240928538/Nigel-Farage-LBC-debate-i-014.jpg?width=640&height=360&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 409 | 409 | ||
| 410 | 410 | And("video meta uploadDate should be set") | |
| 411 | 411 | $("[itemprop='associatedMedia video'] [itemprop=uploadDate]").attribute("content") should be("2014-05-16T16:09:34.000+01:00") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ sealed trait ElementProfile { | |||
| 44 | 44 | bestFor(image).flatMap(_.altText) | |
| 45 | 45 | ||
| 46 | 46 | // NOTE - if you modify this in any way there is a decent chance that you decache all our images :( | |
| 47 | - val qualityparam = if (hidpi) {"q=20"} else {"q=55"} | ||
| 47 | + val qualityparam = if (hidpi) {"quality=45"} else {"quality=85"} | ||
| 48 | 48 | val autoParam = if (autoFormat) "auto=format" else "" | |
| 49 | 49 | val sharpParam = "usm=12" | |
| 50 | 50 | val fitParam = "fit=max" | |
@@ -107,7 +107,7 @@ object Video1280 extends VideoProfile(width = Some(1280), height = Some(720)) // | |||
| 107 | 107 | object GoogleStructuredData extends Profile(width = Some(300), height = Some(300)) // 1:1 | |
| 108 | 108 | ||
| 109 | 109 | class ShareImage(blendImageParam: String, shouldIncludeOverlay: Boolean) extends Profile(width = Some(1200)) { | |
| 110 | - override val heightParam = "h=630" | ||
| 110 | + override val heightParam = "height=630" | ||
| 111 | 111 | override val fitParam = "fit=crop" | |
| 112 | 112 | val cropParam = "crop=faces%2Centropy" | |
| 113 | 113 | val blendModeParam = "bm=normal" | |
@@ -193,13 +193,13 @@ object FacebookOpenGraphImage extends OverlayBase64 { | |||
| 193 | 193 | } | |
| 194 | 194 | ||
| 195 | 195 | object EmailImage extends Profile(width = Some(580), autoFormat = false) { | |
| 196 | - override val qualityparam = "q=40" | ||
| 196 | + override val qualityparam = "quality=60" | ||
| 197 | 197 | val knownWidth = width.get | |
| 198 | 198 | } | |
| 199 | 199 | ||
| 200 | 200 | object EmailVideoImage extends Profile(width = Some(580), autoFormat = false) with OverlayBase64 { | |
| 201 | 201 | override val fitParam = "fit=crop" | |
| 202 | - override val qualityparam = "q=40" | ||
| 202 | + override val qualityparam = "quality=60" | ||
| 203 | 203 | val blendModeParam = "bm=normal" | |
| 204 | 204 | val blendOffsetParam = "ba=center" | |
| 205 | 205 | val blendImageParam = s"blend64=${overlayUrlBase64("play.png")}" | |
@@ -211,15 +211,15 @@ object EmailVideoImage extends Profile(width = Some(580), autoFormat = false) wi | |||
| 211 | 211 | } | |
| 212 | 212 | ||
| 213 | 213 | object FrontEmailImage extends Profile(width = Some(500), autoFormat = false) { | |
| 214 | - override val qualityparam = "q=40" | ||
| 214 | + override val qualityparam = "quality=60" | ||
| 215 | 215 | val knownWidth = width.get | |
| 216 | 216 | } | |
| 217 | 217 | ||
| 218 | 218 | object SmallFrontEmailImage { | |
| 219 | 219 | def apply(customWidth: Int): SmallFrontEmailImage = new SmallFrontEmailImage(customWidth) | |
| 220 | 220 | } | |
| 221 | 221 | class SmallFrontEmailImage(customWidth: Int) extends Profile(Some(customWidth), autoFormat = false) { | |
| 222 | - override val qualityparam = "q=40" | ||
| 222 | + override val qualityparam = "quality=60" | ||
| 223 | 223 | } | |
| 224 | 224 | ||
| 225 | 225 | // The imager/images.js base image. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,12 +84,12 @@ class ImgSrcTest extends FlatSpec with Matchers with GuiceOneAppPerSuite { | |||
| 84 | 84 | ||
| 85 | 85 | "ImgSrc" should "convert the URL of a static image to the resizing endpoint with a /static prefix" in { | |
| 86 | 86 | ImageServerSwitch.switchOn() | |
| 87 | - Item700.bestSrcFor(image).get should startWith (s"$imageHost/img/static/sys-images/Guardian/Pix/pictures/2013/7/5/1373023097878/b6a5a492-cc18-4f30-9809-88467e07ebfa-460x276.jpeg?width=700&q=55&auto=format&usm=12&fit=max&s=") | ||
| 87 | + Item700.bestSrcFor(image).get should startWith (s"$imageHost/img/static/sys-images/Guardian/Pix/pictures/2013/7/5/1373023097878/b6a5a492-cc18-4f30-9809-88467e07ebfa-460x276.jpeg?width=700&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 88 | 88 | } | |
| 89 | 89 | ||
| 90 | 90 | it should "convert the URL of a media service to the resizing endpoint with a /media prefix" in { | |
| 91 | 91 | ImageServerSwitch.switchOn() | |
| 92 | - Item700.bestSrcFor(mediaImage).get should startWith (s"$imageHost/img/media/knly7wcp46fuadowlsnitzpawm/437_0_3819_2291/1000.jpg?width=700&q=55&auto=format&usm=12&fit=max&s=") | ||
| 92 | + Item700.bestSrcFor(mediaImage).get should startWith (s"$imageHost/img/media/knly7wcp46fuadowlsnitzpawm/437_0_3819_2291/1000.jpg?width=700&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 93 | 93 | } | |
| 94 | 94 | ||
| 95 | 95 | it should "not convert the URL of the image if it is disabled" in { | |
@@ -100,13 +100,13 @@ class ImgSrcTest extends FlatSpec with Matchers with GuiceOneAppPerSuite { | |||
| 100 | 100 | it should "convert the URL of the image if it is a PNG (original image from static.guim.co.uk domain)" in { | |
| 101 | 101 | ImageServerSwitch.switchOn() | |
| 102 | 102 | val pngImage = ImageMedia.apply(Seq(ImageAsset.make(asset.copy(file = Some("http://static.guim.co.uk/sys-images/Guardian/Pix/contributor/2014/10/30/1414675415419/Jessica-Valenti-R.png")),0))) | |
| 103 | - Item700.bestSrcFor(pngImage).get should startWith (s"$imageHost/img/static/sys-images/Guardian/Pix/contributor/2014/10/30/1414675415419/Jessica-Valenti-R.png?width=700&q=55&auto=format&usm=12&fit=max&s=") | ||
| 103 | + Item700.bestSrcFor(pngImage).get should startWith (s"$imageHost/img/static/sys-images/Guardian/Pix/contributor/2014/10/30/1414675415419/Jessica-Valenti-R.png?width=700&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 104 | 104 | } | |
| 105 | 105 | ||
| 106 | 106 | it should "convert the URL of the image if it is a PNG (original image from static-secure.guim.co.uk domain)" in { | |
| 107 | 107 | ImageServerSwitch.switchOn() | |
| 108 | 108 | val pngImage = ImageMedia.apply(Seq(ImageAsset.make(asset.copy(file = Some("http://static-secure.guim.co.uk/sys-images/Guardian/Pix/contributor/2014/10/30/1414675415419/Jessica-Valenti-R.png")),0))) | |
| 109 | - Item700.bestSrcFor(pngImage).get should startWith (s"$imageHost/img/static/sys-images/Guardian/Pix/contributor/2014/10/30/1414675415419/Jessica-Valenti-R.png?width=700&q=55&auto=format&usm=12&fit=max&s=") | ||
| 109 | + Item700.bestSrcFor(pngImage).get should startWith (s"$imageHost/img/static/sys-images/Guardian/Pix/contributor/2014/10/30/1414675415419/Jessica-Valenti-R.png?width=700&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 110 | 110 | } | |
| 111 | 111 | ||
| 112 | 112 | it should "not convert the URL of the image if it is a GIF (we do not support animated GIF)" in { | |
@@ -123,12 +123,12 @@ class ImgSrcTest extends FlatSpec with Matchers with GuiceOneAppPerSuite { | |||
| 123 | 123 | ||
| 124 | 124 | it should "convert the URL of a jpeg s3 upload to the resizing endpoint with a /uploads prefix" in { | |
| 125 | 125 | ImageServerSwitch.switchOn() | |
| 126 | - Item700.bestSrcFor(s3UploadJpgImage).get should startWith (s"$imageHost/img/uploads/2016/02/10/Screen_Shot_2016-02-09_at_17.50.09.jpeg?width=700&q=55&auto=format&usm=12&fit=max&s=") | ||
| 126 | + Item700.bestSrcFor(s3UploadJpgImage).get should startWith (s"$imageHost/img/uploads/2016/02/10/Screen_Shot_2016-02-09_at_17.50.09.jpeg?width=700&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | 129 | it should "convert the URL of a png s3 upload to the resizing endpoint with a /uploads prefix" in { | |
| 130 | 130 | ImageServerSwitch.switchOn() | |
| 131 | - Item700.bestSrcFor(s3UploadPNGImage).get should startWith (s"$imageHost/img/uploads/2016/02/04/gu.png?width=700&q=55&auto=format&usm=12&fit=max&s=") | ||
| 131 | + Item700.bestSrcFor(s3UploadPNGImage).get should startWith (s"$imageHost/img/uploads/2016/02/04/gu.png?width=700&quality=85&auto=format&usm=12&fit=max&s=") | ||
| 132 | 132 | } | |
| 133 | 133 | ||
| 134 | 134 | it should "not convert the URL of a gif s3 upload (we do not support animated GIF)" in { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments