{"id":76,"date":"2020-08-28T08:00:00","date_gmt":"2020-08-28T08:00:00","guid":{"rendered":"https:\/\/www.codezma.com\/?p=76"},"modified":"2020-09-03T21:24:26","modified_gmt":"2020-09-03T21:24:26","slug":"benefits-of-exif","status":"publish","type":"post","link":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/","title":{"rendered":"Benefits of EXIF"},"content":{"rendered":"\n<p>Hello guys! I hope you are doing well in these difficult times. Here I\u2019m welcoming you to my very first blog. This blog is about image rotation issues. Most of the times, we start designing the website and issues related to image pops up one by one. At the initial stage, we create a website design by using nice images with matching background where everything is just perfect and when website goes live, the unwanted devil turns up. Because we develop using the designs provided by the designer, we often tend to forget about how the final output will be when the actual data is loaded.<\/p>\n\n\n\n<p>See the below example, here at initial time we show the profile picture in round box and user\u2019s face will show perfectly as we want but sometimes user clicks profile in landscape mode or upload upside down image and it\u2019s look very messy in live website. Now here I\u2019ll try to solve this issue. So, let\u2019s begin&#8230;<\/p>\n\n\n\n<p>We will use <strong>EXIF <\/strong>functions to get image details. It\u2019ll help us to solve our issue and make our site more accessible.<\/p>\n\n\n\n<p>But wait, what is EXIF? EXIF stands for <strong>Exchangeable Image Information <\/strong>and it helps us to read meta data about the images. Now for beginners meta data is \u201cdata about data\u201d like more information about our image. <strong>EXIF <\/strong>functions will help to read details of image like from which digital camera the image was captured, what was aperture of the image, flash, exposure and many such.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"432\" src=\"https:\/\/www.codezma.com\/wp-content\/uploads\/2020\/08\/exif-content1.jpg\" alt=\"exif-content1\" class=\"wp-image-100\" srcset=\"https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/exif-content1.jpg 768w, https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/exif-content1-300x169.jpg 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-style-default\"><p>EXIF data can only read the meta details of JPEG and TIFF images (which is mostly used in digital cameras). So, make sure you use image with the right format while experimenting with the code.<\/p><\/blockquote>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<h2 class=\"wp-block-heading\">EXIF functions:<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. exif_imagetype <\/h3>\n\n\n\n<p>This function accepts the file path and returnsinteger value of that image. For example,if we upload JPEG image,it\u2019ll return 2 (IMAGETYPE_JPEG).<\/p>\n\n\n\n<p> <a rel=\"noreferrer noopener\" href=\"https:\/\/www.php.net\/manual\/en\/function.exif-imagetype.php\" target=\"_blank\">Click here<\/a> to See all image type options from here.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. exif_read_data<\/h3>\n\n\n\n<p>This function is very useful to read meta data of image. It\u2019ll give all possible values of image like type, model number of camera, ApertureFNumber, flash, exposure, ISO, etc. We show all the information in PHP example.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3.exif_thumbnail<\/h3>\n\n\n\n<p>This function is used to generate thumbnail fromtheimage. Here it\u2019ll return the height, width and image type.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay controls loop src=\"https:\/\/www.codezma.com\/wp-content\/uploads\/2020\/08\/exif-video1.mp4\"><\/video><\/figure>\n<\/div><\/div>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/github.com\/codezma\/exif-image-rotation\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"theme-btn\">Get the Code<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello guys! I hope you are doing well in these difficult times. Here I\u2019m welcoming you to my very first blog. This blog is about image rotation issues. Most of the times, we start designing the website and issues related to image pops up one by one. At the initial stage, we create a website design by using nice images with matching background where everything is just perfect and when website goes live, the unwanted devil turns up. Because we develop using the designs provided by the designer, we often tend to forget about how the final output will be when the actual data is loaded.<\/p>\n","protected":false},"author":1,"featured_media":99,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8,9,11,13,10,12],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Benefits of EXIF | Codezma<\/title>\n<meta name=\"description\" content=\"Did you faced image rotation issue and want to easily solve it? Here is the perfect explanation for image rotation issues using EXIF\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Benefits of EXIF | Codezma\" \/>\n<meta property=\"og:description\" content=\"Did you faced image rotation issue and want to easily solve it? Here is the perfect explanation for image rotation issues using EXIF\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/\" \/>\n<meta property=\"og:site_name\" content=\"Codezma\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-28T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-03T21:24:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/exif-cover.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"768\" \/>\n\t<meta property=\"og:image:height\" content=\"285\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"codezma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tech_codezma\" \/>\n<meta name=\"twitter:site\" content=\"@tech_codezma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"codezma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/\"},\"author\":{\"name\":\"codezma\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/#\/schema\/person\/61a44be567e60a6a8450c65301b27ba8\"},\"headline\":\"Benefits of EXIF\",\"datePublished\":\"2020-08-28T08:00:00+00:00\",\"dateModified\":\"2020-09-03T21:24:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/\"},\"wordCount\":397,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.codezma.com\/blogs\/#organization\"},\"keywords\":[\"exif\",\"image\",\"image-rotation\",\"php\",\"rotation\",\"webdesign\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/\",\"url\":\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/\",\"name\":\"Benefits of EXIF | Codezma\",\"isPartOf\":{\"@id\":\"https:\/\/www.codezma.com\/blogs\/#website\"},\"datePublished\":\"2020-08-28T08:00:00+00:00\",\"dateModified\":\"2020-09-03T21:24:26+00:00\",\"description\":\"Did you faced image rotation issue and want to easily solve it? Here is the perfect explanation for image rotation issues using EXIF\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codezma.com\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Benefits of EXIF\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/#website\",\"url\":\"https:\/\/www.codezma.com\/blogs\/\",\"name\":\"Codezma\",\"description\":\"Encode the code\",\"publisher\":{\"@id\":\"https:\/\/www.codezma.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codezma.com\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/#organization\",\"name\":\"Codezma\",\"url\":\"https:\/\/www.codezma.com\/blogs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/favicon.png\",\"contentUrl\":\"https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/favicon.png\",\"width\":512,\"height\":512,\"caption\":\"Codezma\"},\"image\":{\"@id\":\"https:\/\/www.codezma.com\/blogs\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/tech_codezma\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/#\/schema\/person\/61a44be567e60a6a8450c65301b27ba8\",\"name\":\"codezma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codezma.com\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/da83f505510489c5777663984f7ca62f?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/da83f505510489c5777663984f7ca62f?s=96&r=g\",\"caption\":\"codezma\"},\"sameAs\":[\"https:\/\/www.codezma.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Benefits of EXIF | Codezma","description":"Did you faced image rotation issue and want to easily solve it? Here is the perfect explanation for image rotation issues using EXIF","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/","og_locale":"en_US","og_type":"article","og_title":"Benefits of EXIF | Codezma","og_description":"Did you faced image rotation issue and want to easily solve it? Here is the perfect explanation for image rotation issues using EXIF","og_url":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/","og_site_name":"Codezma","article_published_time":"2020-08-28T08:00:00+00:00","article_modified_time":"2020-09-03T21:24:26+00:00","og_image":[{"width":768,"height":285,"url":"https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/exif-cover.jpg","type":"image\/jpeg"}],"author":"codezma","twitter_card":"summary_large_image","twitter_creator":"@tech_codezma","twitter_site":"@tech_codezma","twitter_misc":{"Written by":"codezma","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#article","isPartOf":{"@id":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/"},"author":{"name":"codezma","@id":"https:\/\/www.codezma.com\/blogs\/#\/schema\/person\/61a44be567e60a6a8450c65301b27ba8"},"headline":"Benefits of EXIF","datePublished":"2020-08-28T08:00:00+00:00","dateModified":"2020-09-03T21:24:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/"},"wordCount":397,"commentCount":0,"publisher":{"@id":"https:\/\/www.codezma.com\/blogs\/#organization"},"keywords":["exif","image","image-rotation","php","rotation","webdesign"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/","url":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/","name":"Benefits of EXIF | Codezma","isPartOf":{"@id":"https:\/\/www.codezma.com\/blogs\/#website"},"datePublished":"2020-08-28T08:00:00+00:00","dateModified":"2020-09-03T21:24:26+00:00","description":"Did you faced image rotation issue and want to easily solve it? Here is the perfect explanation for image rotation issues using EXIF","breadcrumb":{"@id":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.codezma.com\/blogs\/php\/benefits-of-exif\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codezma.com\/blogs\/"},{"@type":"ListItem","position":2,"name":"Benefits of EXIF"}]},{"@type":"WebSite","@id":"https:\/\/www.codezma.com\/blogs\/#website","url":"https:\/\/www.codezma.com\/blogs\/","name":"Codezma","description":"Encode the code","publisher":{"@id":"https:\/\/www.codezma.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codezma.com\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codezma.com\/blogs\/#organization","name":"Codezma","url":"https:\/\/www.codezma.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codezma.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/favicon.png","contentUrl":"https:\/\/www.codezma.com\/blogs\/wp-content\/uploads\/2020\/08\/favicon.png","width":512,"height":512,"caption":"Codezma"},"image":{"@id":"https:\/\/www.codezma.com\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/tech_codezma"]},{"@type":"Person","@id":"https:\/\/www.codezma.com\/blogs\/#\/schema\/person\/61a44be567e60a6a8450c65301b27ba8","name":"codezma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codezma.com\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/da83f505510489c5777663984f7ca62f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/da83f505510489c5777663984f7ca62f?s=96&r=g","caption":"codezma"},"sameAs":["https:\/\/www.codezma.com"]}]}},"_links":{"self":[{"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/posts\/76"}],"collection":[{"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":19,"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/posts\/76\/revisions\/131"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/media\/99"}],"wp:attachment":[{"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codezma.com\/blogs\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}