{"id":3052,"date":"2017-05-25T09:19:29","date_gmt":"2017-05-25T14:19:29","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/?p=3052"},"modified":"2017-05-25T09:19:29","modified_gmt":"2017-05-25T14:19:29","slug":"creating-a-test-to-find-incorrect-size-images","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2017\/05\/25\/creating-a-test-to-find-incorrect-size-images\/","title":{"rendered":"Creating a Test to Find Incorrect Size Images"},"content":{"rendered":"<p>If I find a defect on our website, I first look for other similar defects and then create a test that runs regularly to catch future occurrences. I recently noticed a video thumbnail was not the correct aspect ratio: it was 4:3 instead of 16:9, like the middle one in this list of three:<br \/>\n<a href=\"https:\/\/blogs.mathworks.com\/videos\/files\/thumbnail-aspect-ratio1.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"300\" height=\"295\" src=\"https:\/\/blogs.mathworks.com\/videos\/files\/thumbnail-aspect-ratio1-300x295.jpg\" alt=\"\" class=\"alignnone size-medium wp-image-3053\" \/><\/a><\/p>\n<p>So here I write a script to find any video thumbnails on our website that are the wrong aspect ratio. Features covered in this <a href=\"https:\/\/blogs.mathworks.com\/videos\/2015\/10\/29\/matlab-code-along-videos\/\">code-along<\/a> style video include:<\/p>\n<ul>\n<li><tt>webread<\/tt><\/li>\n<li><tt>table<\/tt><\/li>\n<\/ul>\n<p><div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"5446875352001\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div><\/p>\n<p>Play the video in full screen mode for a better viewing experience.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"thumbnail thumbnail_asset asset_overlay video\"><a href=\"https:\/\/blogs.mathworks.com\/videos\/2017\/05\/25\/creating-a-test-to-find-incorrect-size-images\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/0eb7b763-1fe4-4bdf-a2d0-636c5205e114\/758d98aa-034f-41e1-ad97-127b18ca6a35\/1280x720\/match\/image.jpg\" onError=\"this.style.display ='none';\"\/><\/p>\n<div class=\"overlay_container\">\n      <span class=\"icon-video icon_color_null\"><time class=\"video_length\">49:12<\/time><\/span>\n      <\/div>\n<p>      <\/a><\/div>\n<p>If I find a defect on our website, I first look for other similar defects and then create a test that runs regularly to catch future occurrences. I recently noticed a video thumbnail was not the&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2017\/05\/25\/creating-a-test-to-find-incorrect-size-images\/\">read more >><\/a><\/p>\n","protected":false},"author":133,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[27,4],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/3052"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/users\/133"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/comments?post=3052"}],"version-history":[{"count":14,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/3052\/revisions"}],"predecessor-version":[{"id":3067,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/3052\/revisions\/3067"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=3052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=3052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=3052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}