{"id":26,"date":"2024-04-20T10:15:39","date_gmt":"2024-04-20T18:15:39","guid":{"rendered":"https:\/\/tonybhimani.com\/programming-blog\/?p=26"},"modified":"2024-04-24T12:47:28","modified_gmt":"2024-04-24T20:47:28","slug":"php-imagemagick-to-crop-square-and-pad-an-image","status":"publish","type":"post","link":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/","title":{"rendered":"PHP + ImageMagick to Crop, Square, and Pad an Image"},"content":{"rendered":"\r\n<p>This isn&#8217;t anything new as there are plenty of scripts and tools out there to accomplish the given goal, but sometimes it&#8217;s easier to implement your own solution. Frankly, I got tired of manually editing images that followed the same formatting guidelines so I wrote this script to speed up the conversion process. I used PHP, however any language like Python, Ruby, etc would work as long as it can execute shell commands. If you have a plugin extension for ImageMagick then that would be a better option, but I didn&#8217;t want to bother with PECL.<\/p>\r\n\r\n\r\n\r\n<p>The use case here is I have a bunch of given product images of varying sizes and pixel paddings i.e. empty surrounding solid color space. For each image I&#8217;d load it in GIMP, run a crop to remove the excess padding, take the higher of the two values (width or height), multiply it by a scale factor and round up, edit the canvas width and height to that new value, center the image content, drop in a new white background layer, bring the original layer to the top, merge down, save to overwrite the image. This is a very painful manual process and batch processing images should be easier &#8212; hence this script.<\/p>\r\n\r\n\r\n\r\n<p>Before you try it it, keep in mind I was doing this on Windows so the executable names may vary for ImageMagick on Linux or Mac. It&#8217;s been a while since I&#8217;ve used it on Linux and I vaguely remember the tool being called <strong>convert<\/strong>. Running that program of the same name on Windows wanted to modify my hard disk. Yikes! ImageMagick&#8217;s install location is in my environment variables so there are no paths in the script. Also, I didn&#8217;t include any error checking like if images don&#8217;t get generated. Feel free to add that yourself.<\/p>\r\n\r\n\r\n\r\n<p>Run it from the command line and pass in the image filename (local or url) as the first argument. The second argument, image output filename, is optional.<\/p>\r\n<pre>\r\nC:\\Users\\Tony> php -f process_image.php image.jpg\r\n<\/pre>\r\n<p>It currently works on a single image. Yes, I know, that does contradict my earlier statement of batch processing, but I was in a rush. <s>I&#8217;ll make an update and do a follow-up post soon.<\/s><\/p>\r\n\r\n\r\n<pre><pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\n\/*******************************************************\r\n\r\n\tVIA IMAGEMAGICK\r\n\t\tCROP THE EXCESS SPACE AROUND THE IMAGE\r\n\t\tCALCULATE NEW WIDTH &amp; HEIGHT FROM SCALE\r\n\t\tRE-FIT THE IMAGE TO NEW SIZE WITH PADDING\r\n\r\n*******************************************************\/\r\n\r\n\/\/ get input filename\r\n$img1 = $argv&#x5B;1];\r\nif (!$img1) die(&quot;Specify input local image or url\\n&quot;);\r\n\r\n\/\/ get output filename\r\n$img2 = $argv&#x5B;2];\r\n\r\n\/\/ path info\r\n$path_parts = pathinfo($img1);\r\n$basename = $path_parts&#x5B;&quot;basename&quot;];\r\n$filename = $path_parts&#x5B;&quot;filename&quot;];\r\n$extension = $path_parts&#x5B;&quot;extension&quot;];\r\n\r\n\/\/ input filename\r\necho &quot;input file =&gt; &quot;;\r\necho $img1;\r\necho &quot;\\n&quot;;\r\n\r\n\/\/ only checking for http(s) prefix\r\nif (preg_match(&quot;\/^https?:\\\/\\\/\/i&quot;, $img1)) {\r\n\t$data = file_get_contents($img1);\r\n\tfile_put_contents($basename, $data);\r\n\t$img1 = $basename;\r\n}\r\n\r\n\/\/ output filename not set\r\nif (!$img2) $img2 = sprintf(&quot;%s_out.%s&quot;, $filename, $extension);\r\n\r\n\/\/ temp names\r\n$tmp1 = sprintf(&quot;%s_tmp1.%s&quot;, $filename, $extension);\r\n$tmp2 = sprintf(&quot;%s_tmp2.%s&quot;, $filename, $extension);\r\n\r\n\/\/ scale factor\r\n$scale_factor = 1.125;\r\n\r\n\/\/ first crop\r\n$crop = sprintf(&#039;magick %s -fuzz 1%% -trim +repage %s&#039;, $img1, $tmp1);\r\n$result = shell_exec($crop);\r\n\r\n\/\/ then get size\r\n$identify = sprintf(&#039;identify -ping -format &quot;%%&#x5B;width] %%&#x5B;height]&quot; %s&#039;, $tmp1);\r\n$result = shell_exec($identify);\r\n\r\n\/\/ width x height\r\n$dimensions = @explode(&quot; &quot;, $result);\r\n\r\n\/\/ see dimensions\r\necho &quot;dimensions =&gt; &quot;;\r\necho sprintf(&quot;%sx%s&quot;, $dimensions&#x5B;0], $dimensions&#x5B;1]);\r\necho &quot;\\n&quot;;\r\n\r\n\/\/ bigger of the two\r\n$max_size = max($dimensions);\r\necho &quot;max size =&gt; &quot;;\r\necho $max_size;\r\necho &quot;\\n&quot;;\r\n\r\n\/\/ scale factor from above\r\necho &quot;scale factor =&gt; &quot;;\r\necho $scale_factor;\r\necho &quot;\\n&quot;;\r\n\r\n\/\/ calculate new size (width and height will be the same)\r\n$new_size = ceil(($max_size * $scale_factor) \/ 10) * 10;\r\necho &quot;new size =&gt; &quot;;\r\necho $new_size;\r\necho &quot;\\n&quot;;\r\n\r\n\/\/ make new image\r\n$make = sprintf(&#039;magick %s -background White -gravity center -extent %sx%s %s&#039;, $tmp1, $new_size, $new_size, $img2);\r\n$result = shell_exec($make);\r\n\r\n\/\/ remove temp file\r\nunlink($tmp1);\r\n\r\n\/\/ output filename\r\necho &quot;output file =&gt; &quot;;\r\necho $img2;\r\necho &quot;\\n&quot;;\r\n\r\n?&gt;\r\n<\/pre><\/pre>\r\n\r\n\r\n\r\n<p><strong>Update 4\/24\/2024<\/strong><\/p>\r\n<p>Here is a quick and dirty wrapper script &#8212; I decided to leave the original as is. You can pass it a file containing a list of image filenames and\/or URLs as the only argument. It&#8217;s going to use the default generated output names, but you could upgrade it. CSV, JSON, or another format where you could specify both the input and output filenames.<\/p>\r\n<pre>\r\nC:\\Users\\Tony> php -f image_batch.php list.txt\r\n<\/pre>\r\n\r\n\r\n<pre><pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\n\/*******************************************************\r\n\r\n\tWRAPPER SCRIPT FOR BATCH PROCESSING IMAGES\r\n\r\n*******************************************************\/\r\n\r\n\/\/ list of images input file\r\n$batch_file = $argv&#x5B;1];\r\nif (!$batch_file) die(&quot;Specify list of images input file\\n&quot;);\r\n\r\n\/\/ read in the image filenames \/ urls to an array\r\n$images = file($batch_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\r\n\r\n\/\/ shell exec the image processing script\r\nforeach ($images as $image) {\r\n\techo shell_exec(sprintf(&quot;php -f process_image.php %s&quot;, $image));\r\n\techo &quot;\\n&quot;;\r\n}\r\n\r\n?&gt;\r\n<\/pre><\/pre>\r\n\r\n\r\n<p><strong>Resources:<\/strong><\/p>\r\n<ul>\r\n<li><a href=\"https:\/\/www.php.net\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">PHP: Hypertext Preprocessor<\/a><\/li>\r\n<li><a href=\"https:\/\/www.imagemagick.org\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">ImageMagick \u2013 Create, Edit, Compose, or Convert Digital Images<\/a><\/li>\r\n<\/ul>\r\n","protected":false},"excerpt":{"rendered":"<p>This isn&#8217;t anything new as there are plenty of scripts and tools out there to accomplish the given goal, but sometimes it&#8217;s easier to implement your own solution. Frankly, I got tired of manually editing images that followed the same formatting guidelines so I wrote this script to speed up the conversion process. I used [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[10,11,9],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-scripts","tag-image-editing","tag-imagemagick","tag-php-script"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP + ImageMagick to Crop, Square, and Pad an Image - Tony&#039;s Programming Blog and Development Journal<\/title>\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.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP + ImageMagick to Crop, Square, and Pad an Image - Tony&#039;s Programming Blog and Development Journal\" \/>\n<meta property=\"og:description\" content=\"This isn&#8217;t anything new as there are plenty of scripts and tools out there to accomplish the given goal, but sometimes it&#8217;s easier to implement your own solution. Frankly, I got tired of manually editing images that followed the same formatting guidelines so I wrote this script to speed up the conversion process. I used [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/\" \/>\n<meta property=\"og:site_name\" content=\"Tony&#039;s Programming Blog and Development Journal\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-20T18:15:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-24T20:47:28+00:00\" \/>\n<meta name=\"author\" content=\"Tony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@TonyBhimani\" \/>\n<meta name=\"twitter:site\" content=\"@TonyBhimani\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tony\" \/>\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.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/\"},\"author\":{\"name\":\"Tony\",\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88\"},\"headline\":\"PHP + ImageMagick to Crop, Square, and Pad an Image\",\"datePublished\":\"2024-04-20T18:15:39+00:00\",\"dateModified\":\"2024-04-24T20:47:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/\"},\"wordCount\":466,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88\"},\"keywords\":[\"image editing\",\"imagemagick\",\"php script\"],\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/\",\"url\":\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/\",\"name\":\"PHP + ImageMagick to Crop, Square, and Pad an Image - Tony&#039;s Programming Blog and Development Journal\",\"isPartOf\":{\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/#website\"},\"datePublished\":\"2024-04-20T18:15:39+00:00\",\"dateModified\":\"2024-04-24T20:47:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.tonybhimani.com\/programming-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP + ImageMagick to Crop, Square, and Pad an Image\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/#website\",\"url\":\"https:\/\/www.tonybhimani.com\/programming-blog\/\",\"name\":\"Tony's Programming Blog and Development Journal\",\"description\":\"Sharing is caring... Especially with code\",\"publisher\":{\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tonybhimani.com\/programming-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88\",\"name\":\"Tony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g\",\"caption\":\"Tony\"},\"logo\":{\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g\"},\"sameAs\":[\"https:\/\/tonybhimani.com\/programming-blog\",\"https:\/\/x.com\/TonyBhimani\",\"https:\/\/www.youtube.com\/tonybhimani\"],\"url\":\"https:\/\/www.tonybhimani.com\/programming-blog\/author\/coding_magik\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP + ImageMagick to Crop, Square, and Pad an Image - Tony&#039;s Programming Blog and Development Journal","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.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/","og_locale":"en_US","og_type":"article","og_title":"PHP + ImageMagick to Crop, Square, and Pad an Image - Tony&#039;s Programming Blog and Development Journal","og_description":"This isn&#8217;t anything new as there are plenty of scripts and tools out there to accomplish the given goal, but sometimes it&#8217;s easier to implement your own solution. Frankly, I got tired of manually editing images that followed the same formatting guidelines so I wrote this script to speed up the conversion process. I used [&hellip;]","og_url":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/","og_site_name":"Tony&#039;s Programming Blog and Development Journal","article_published_time":"2024-04-20T18:15:39+00:00","article_modified_time":"2024-04-24T20:47:28+00:00","author":"Tony","twitter_card":"summary_large_image","twitter_creator":"@TonyBhimani","twitter_site":"@TonyBhimani","twitter_misc":{"Written by":"Tony","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#article","isPartOf":{"@id":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/"},"author":{"name":"Tony","@id":"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88"},"headline":"PHP + ImageMagick to Crop, Square, and Pad an Image","datePublished":"2024-04-20T18:15:39+00:00","dateModified":"2024-04-24T20:47:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/"},"wordCount":466,"commentCount":0,"publisher":{"@id":"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88"},"keywords":["image editing","imagemagick","php script"],"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/","url":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/","name":"PHP + ImageMagick to Crop, Square, and Pad an Image - Tony&#039;s Programming Blog and Development Journal","isPartOf":{"@id":"https:\/\/www.tonybhimani.com\/programming-blog\/#website"},"datePublished":"2024-04-20T18:15:39+00:00","dateModified":"2024-04-24T20:47:28+00:00","breadcrumb":{"@id":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.tonybhimani.com\/programming-blog\/php-imagemagick-to-crop-square-and-pad-an-image\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tonybhimani.com\/programming-blog\/"},{"@type":"ListItem","position":2,"name":"PHP + ImageMagick to Crop, Square, and Pad an Image"}]},{"@type":"WebSite","@id":"https:\/\/www.tonybhimani.com\/programming-blog\/#website","url":"https:\/\/www.tonybhimani.com\/programming-blog\/","name":"Tony's Programming Blog and Development Journal","description":"Sharing is caring... Especially with code","publisher":{"@id":"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tonybhimani.com\/programming-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.tonybhimani.com\/programming-blog\/#\/schema\/person\/036db10e4bc2069453a60f580f91ab88","name":"Tony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g","caption":"Tony"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/ed5a2a00dc5d9679e1fd2f29f60ca885a8e0f9d2c1aa2b5dabf05af02663b46c?s=96&r=g"},"sameAs":["https:\/\/tonybhimani.com\/programming-blog","https:\/\/x.com\/TonyBhimani","https:\/\/www.youtube.com\/tonybhimani"],"url":"https:\/\/www.tonybhimani.com\/programming-blog\/author\/coding_magik\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":45,"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":118,"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/posts\/26\/revisions\/118"}],"wp:attachment":[{"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tonybhimani.com\/programming-blog\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}