{"id":2099,"date":"2015-11-02T19:57:20","date_gmt":"2015-11-02T18:57:20","guid":{"rendered":"https:\/\/www.modelical.com\/?p=738"},"modified":"2024-07-12T14:57:46","modified_gmt":"2024-07-12T12:57:46","slug":"how-to-script-forty-photoshop","status":"publish","type":"post","link":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/","title":{"rendered":"How to Script Photoshop &#8211; In Depth"},"content":{"rendered":"<h3>Where do we come from?<\/h3>\n<p>I know that the last chapter in the &#8220;How to Script for Photoshop&#8221; series was not very well received. The fact that nobody read it and the revealing information on Google Trends about the topic, has not been enough to break my will. It is the absurd thing about my will that encourages me to go on. Or sideways. Or backwards. Or still. To go anyway, even stopped. Because I can go on without moving. I can even\u00a0displace myself without moving. But that could be a topic for a new post, we will see.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-3977 size-full\" src=\"https:\/\/www.modelical.com\/wp-content\/uploads\/2014\/09\/trend.png\" alt=\"\" \/>The ugly truth (sorry for the Spanish screenshot)<\/p>\n<p>And that peak is not because of me \ud83d\ude41<\/p>\n<p>On the first chapter we were introduced in the Photoshop development environment usage, with a simple case. As we were saying the last time, we could have done that example with a Photoshop action, without having to write a single line of code. And that was done in purpose. Now, we are going to expand the aim of the script, reusing the code from the last chapter.<\/p>\n<h3>Where are we going?<\/h3>\n<p>Let&#8217;s add two goals for our script:<\/p>\n<ul>\n<li>Get different aspect ratio output images from the source image.<\/li>\n<li>Save the output images as JPEG, only if the source is JPEG, otherwise we will save as PNG.<\/li>\n<\/ul>\n<p>As you can see, these goals are very difficult to achieve using only Photoshop actions.<\/p>\n<p>Let&#8217;s start modifying our script, adding an array with the aspect ratio values we want for the output images:<\/p>\n<pre class=\"lang:js decode:true\">var aspectRatio = [ [ 1, 1 ], [ 4, 3 ], [ 16, 9 ] ];<\/pre>\n<p>In this array we can add any aspect ratio we are interested on, like 5:4, 16:10, change it according your needs. Who is being obtuse now?<\/p>\n<p>Now we are going to crop our image, so we need to calculate the new dimensions. But, stop right there you avid programmer! Approach no further! Let&#8217;s meditate. I made this pretty drawing. I like drawings. I hope it will be useful for our purposes.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-3976 size-full\" src=\"https:\/\/www.modelical.com\/wp-content\/uploads\/2014\/09\/ar-e1485621688579.png\" alt=\"\" \/> A pretty drawing<\/p>\n<p>What this drawing is telling us is that we have to take into account the aspect ratio of the source image to know where we have to cut the image. As \u00a0you can see, we are assuming that the source image will be always centered in the ouput image. I did not want to advance any contents, but, in the next chapter we will be trying to let the user decide the center of the cropped image. Who is being obtuse now?<\/p>\n<p>Let&#8217;s concretize this in code, please:<\/p>\n<pre class=\"lang:js decode:true\">var imageAspectRatio = doc.width \/ doc.height;\r\nvar currentAspectRatio = aspectRatio[j][0] \/ aspectRatio[j][1];\r\n\r\nvar tImageWidth = imageWidth;\r\nvar tImageHeight = imageHeight;\r\n\r\nif(  imageAspectRatio &gt; currentAspectRatio ) {\r\n\ttImageWidth = Math.round( aspectRatio[j][0] * imageHeight \/ aspectRatio[j][1] );\r\n} else {\r\n\ttImageHeight = Math.round( aspectRatio[j][1] * imageWidth \/ aspectRatio[j][0] );\r\n}<\/pre>\n<p>If we try to explain this with a more human language, but intrinsically more inaccurate, we have that if the source image aspect ratio is greater than the output aspect ratio, then we have to crop on the sides of the image. In other case, we have to crop the top and bottom parts.<\/p>\n<p>We crop the image, and then we resample it using our target height:<\/p>\n<pre class=\"lang:js decode:true\">doc.resizeCanvas( tImageWidth, tImageHeight, AnchorPosition.MIDDLECENTER );\r\n\r\nvar outputName = filePath + \"\/\" + fileName;\r\n\r\nvar fileSuffix = \"_\" + aspectRatio[j][0] + \"x\" + aspectRatio[j][1];\r\n\r\nif( imageHeight &gt; targetHeight ) {\r\n\tvar tWidth = Math.round( aspectRatio[j][0] * targetHeight \/ aspectRatio[j][1] );\r\n\tdoc.resizeImage( tWidth, targetHeight );\r\n\t\r\n\tvar fileName = getFileName( doc );\r\n\r\n\tfileSuffix += \"_\" + targetHeight;\r\n}\r\n\t\r\nfileName.name += fileSuffix;\r\nsaveFile( doc, fileName );\r\n<\/pre>\n<p>In this section we introduce the use of the <span class=\"lang:c# decode:true crayon-inline\">resizeCanvas<\/span>\u00a0functions. As you can see, it takes three parameters: width, height and anchor point. In this chapter we will use a fixed anchor point.<\/p>\n<p>At the same time, we are updating a variable that hold the final name of the output image, with the information that will enable us to identify the image. Notice that the <span class=\"lang:js decode:true crayon-inline\">fileName<\/span>\u00a0variable it is a pseudo-object, with two fields,\u00a0<span class=\"lang:js decode:true crayon-inline\">name<\/span>\u00a0and\u00a0<span class=\"lang:js decode:true crayon-inline\">extension<\/span>.<\/p>\n<p>In order to achieve our second goal, we are going to modify the <span class=\"lang:js decode:true crayon-inline\">saveFile<\/span>\u00a0function that we used in the previous chapter:<\/p>\n<pre class=\"lang:js decode:true \">function saveFile( doc, fileName ) {\r\n    if( fileName.extension == \".jpg\" || fileName.extension == \".jpeg\" ) {\r\n        fileName.name += \".jpg\";\r\n        var jpegOptions = new JPEGSaveOptions();\r\n        jpegOptions.quality = 10;\r\n        jpegOptions.embedColorProfile = true;\r\n        doc.saveAs( File( fileName.name ), jpegOptions, true );\r\n    } else {\r\n        fileName.name += \".png\";\r\n        var pngOptions = new PNGSaveOptions();\r\n        pngOptions.compression = 9;\r\n        doc.saveAs( File( fileName.name ), pngOptions, true );\r\n    }\r\n}<\/pre>\n<p>The part that saves the output image as JPEG is the same, we only added the option to save as PNG too.<\/p>\n<p>And that is all! Let&#8217;s see how it looks all together:<\/p>\n<pre class=\"lang:js decode:true\">var targetHeight = 512;\r\nvar aspectRatio = [ [ 1, 1 ], [ 4, 3 ], [ 16, 9 ] ];\r\n\r\nfor (var i = 0; i &lt; app.documents.length; i++) {\r\n\tvar doc = app.documents[i];\r\n\tapp.activeDocument = doc;\r\n\tvar imageWidth = doc.width;\r\n\tvar imageHeight = doc.height;\r\n\tvar imageAspectRatio = doc.width \/ doc.height;\r\n    \r\n    for (var j = 0; j &lt; aspectRatio.length; j++) {\r\n        var currentAspectRatio = aspectRatio[j][0] \/ aspectRatio[j][1];\r\n\r\n        var tImageWidth = imageWidth;\r\n        var tImageHeight = imageHeight;\r\n\r\n        if(  imageAspectRatio &gt; currentAspectRatio ) {\r\n            tImageWidth = Math.round( aspectRatio[j][0] * imageHeight \/ aspectRatio[j][1] );\r\n        } else {\r\n            tImageHeight = Math.round( aspectRatio[j][1] * imageWidth \/ aspectRatio[j][0] );\r\n        }\r\n    \r\n        doc.resizeCanvas( tImageWidth, tImageHeight, anchorPosition );\r\n\r\n        var outputName = filePath + \"\/\" + fileName;\r\n\r\n        var fileSuffix = \"_\" + aspectRatio[j][0] + \"x\" + aspectRatio[j][1];\r\n\r\n        if( imageHeight &gt; targetHeight ) {\r\n            var tWidth = Math.round( aspectRatio[j][0] * targetHeight \/ aspectRatio[j][1] );\r\n            doc.resizeImage( tWidth, targetHeight );\r\n            \r\n            var fileName = getFileName( doc );\r\n\r\n            fileName.name += \"_\" + targetHeight;\r\n        }\r\n            \r\n        fileName.name += fileSuffix;\r\n        saveFile( doc, fileName );\r\n    }\r\n}\r\n\r\nfunction getFileName( doc ) {\r\n    var filePath = doc.path.toString();\r\n    var fileName = doc.name.toString();\r\n\r\n    var lastDot = fileName.lastIndexOf( \".\" );\r\n    if ( lastDot == -1 ) {\r\n        lastDot = fileName.length;\r\n    }\r\n\r\n    var fileExtension = fileName.substr( lastDot );\r\n    var fileName = fileName.substr( 0, lastDot );\r\n\r\n    var outputName = filePath + \"\/\" + fileName;\r\n\r\n    return { name: outputName, extension: fileExtension };\r\n}\r\n\r\nfunction saveFile( doc, fileName ) {\r\n    if( fileName.extension == \".jpg\" || fileName.extension == \".jpeg\" ) {\r\n        fileName.name += \".jpg\";\r\n        var jpegOptions = new JPEGSaveOptions();\r\n        jpegOptions.quality = 10;\r\n        jpegOptions.embedColorProfile = true;\r\n        doc.saveAs( File( fileName.name ), jpegOptions, true );\r\n    } else {\r\n        fileName.name += \".png\";\r\n        var pngOptions = new PNGSaveOptions();\r\n        pngOptions.compression = 9;\r\n        doc.saveAs( File( fileName.name ), pngOptions, true );\r\n    }\r\n}\r\n<\/pre>\n<h3>What are we?<\/h3>\n<p>In the next chapter, we will take a look at the Photoshop plug-in we talked in the first chapter about. This plug-in will make us able to dump the actions made in the UI as JavaScript code, so we can use some Photoshop features not available in the API otherwise. We will also talk about custom dialog. Because sometimes you need human interaction. That human warmth that our inner animal needs from time to time (some people more than others and some people never). Stay tuned.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Where do we come from? I know that the last chapter in the &#8220;How to Script for Photoshop&#8221; series was not very well received. The fact that nobody read it and the revealing information on Google Trends about the topic, has not been enough to break my will. It is the absurd thing about my [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":27099,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[780],"class_list":["post-2099","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guidelines","tag-technology-other"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Script Photoshop - In Depth - Modelical<\/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.modelical.com\/en\/how-to-script-forty-photoshop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Script Photoshop - In Depth - Modelical\" \/>\n<meta property=\"og:description\" content=\"Where do we come from? I know that the last chapter in the &#8220;How to Script for Photoshop&#8221; series was not very well received. The fact that nobody read it and the revealing information on Google Trends about the topic, has not been enough to break my will. It is the absurd thing about my [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/\" \/>\n<meta property=\"og:site_name\" content=\"Modelical\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Modelical\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-02T18:57:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-12T12:57:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/11\/Posts_29_PS-400x250-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"250\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Juan Manuel Perez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@modelical\" \/>\n<meta name=\"twitter:site\" content=\"@modelical\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Juan Manuel Perez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/\"},\"author\":{\"name\":\"Juan Manuel Perez\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#\\\/schema\\\/person\\\/c9c2467429fc6feb888f8bd2300b70de\"},\"headline\":\"How to Script Photoshop &#8211; In Depth\",\"datePublished\":\"2015-11-02T18:57:20+00:00\",\"dateModified\":\"2024-07-12T12:57:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/\"},\"wordCount\":717,\"image\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Posts_29_PS-400x250-1.jpg\",\"keywords\":[\"Tec Other\"],\"articleSection\":[\"Guidelines\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/\",\"url\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/\",\"name\":\"How to Script Photoshop - In Depth - Modelical\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Posts_29_PS-400x250-1.jpg\",\"datePublished\":\"2015-11-02T18:57:20+00:00\",\"dateModified\":\"2024-07-12T12:57:46+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#\\\/schema\\\/person\\\/c9c2467429fc6feb888f8bd2300b70de\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/how-to-script-forty-photoshop\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Posts_29_PS-400x250-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.modelical.com\\\/wp-content\\\/uploads\\\/2015\\\/11\\\/Posts_29_PS-400x250-1.jpg\",\"width\":400,\"height\":250},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/\",\"name\":\"Modelical\",\"description\":\"We build information\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/#\\\/schema\\\/person\\\/c9c2467429fc6feb888f8bd2300b70de\",\"name\":\"Juan Manuel Perez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/945465eff02d16d8d02a0853f9d484ad26660cf20c44978db2c7bae51957c5d0?s=96&d=initials&r=g&initials=ju\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/945465eff02d16d8d02a0853f9d484ad26660cf20c44978db2c7bae51957c5d0?s=96&d=initials&r=g&initials=ju\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/945465eff02d16d8d02a0853f9d484ad26660cf20c44978db2c7bae51957c5d0?s=96&d=initials&r=g&initials=ju\",\"caption\":\"Juan Manuel Perez\"},\"url\":\"https:\\\/\\\/www.modelical.com\\\/en\\\/author\\\/juanma\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Script Photoshop - In Depth - Modelical","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.modelical.com\/en\/how-to-script-forty-photoshop\/","og_locale":"en_US","og_type":"article","og_title":"How to Script Photoshop - In Depth - Modelical","og_description":"Where do we come from? I know that the last chapter in the &#8220;How to Script for Photoshop&#8221; series was not very well received. The fact that nobody read it and the revealing information on Google Trends about the topic, has not been enough to break my will. It is the absurd thing about my [&hellip;]","og_url":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/","og_site_name":"Modelical","article_publisher":"https:\/\/www.facebook.com\/Modelical\/","article_published_time":"2015-11-02T18:57:20+00:00","article_modified_time":"2024-07-12T12:57:46+00:00","og_image":[{"width":400,"height":250,"url":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/11\/Posts_29_PS-400x250-1.jpg","type":"image\/jpeg"}],"author":"Juan Manuel Perez","twitter_card":"summary_large_image","twitter_creator":"@modelical","twitter_site":"@modelical","twitter_misc":{"Written by":"Juan Manuel Perez","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/#article","isPartOf":{"@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/"},"author":{"name":"Juan Manuel Perez","@id":"https:\/\/www.modelical.com\/en\/#\/schema\/person\/c9c2467429fc6feb888f8bd2300b70de"},"headline":"How to Script Photoshop &#8211; In Depth","datePublished":"2015-11-02T18:57:20+00:00","dateModified":"2024-07-12T12:57:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/"},"wordCount":717,"image":{"@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/#primaryimage"},"thumbnailUrl":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/11\/Posts_29_PS-400x250-1.jpg","keywords":["Tec Other"],"articleSection":["Guidelines"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/","url":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/","name":"How to Script Photoshop - In Depth - Modelical","isPartOf":{"@id":"https:\/\/www.modelical.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/#primaryimage"},"image":{"@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/#primaryimage"},"thumbnailUrl":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/11\/Posts_29_PS-400x250-1.jpg","datePublished":"2015-11-02T18:57:20+00:00","dateModified":"2024-07-12T12:57:46+00:00","author":{"@id":"https:\/\/www.modelical.com\/en\/#\/schema\/person\/c9c2467429fc6feb888f8bd2300b70de"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.modelical.com\/en\/how-to-script-forty-photoshop\/#primaryimage","url":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/11\/Posts_29_PS-400x250-1.jpg","contentUrl":"https:\/\/www.modelical.com\/wp-content\/uploads\/2015\/11\/Posts_29_PS-400x250-1.jpg","width":400,"height":250},{"@type":"WebSite","@id":"https:\/\/www.modelical.com\/en\/#website","url":"https:\/\/www.modelical.com\/en\/","name":"Modelical","description":"We build information","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.modelical.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.modelical.com\/en\/#\/schema\/person\/c9c2467429fc6feb888f8bd2300b70de","name":"Juan Manuel Perez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/945465eff02d16d8d02a0853f9d484ad26660cf20c44978db2c7bae51957c5d0?s=96&d=initials&r=g&initials=ju","url":"https:\/\/secure.gravatar.com\/avatar\/945465eff02d16d8d02a0853f9d484ad26660cf20c44978db2c7bae51957c5d0?s=96&d=initials&r=g&initials=ju","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/945465eff02d16d8d02a0853f9d484ad26660cf20c44978db2c7bae51957c5d0?s=96&d=initials&r=g&initials=ju","caption":"Juan Manuel Perez"},"url":"https:\/\/www.modelical.com\/en\/author\/juanma\/"}]}},"_links":{"self":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/posts\/2099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/comments?post=2099"}],"version-history":[{"count":0,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/posts\/2099\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/media\/27099"}],"wp:attachment":[{"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/media?parent=2099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/categories?post=2099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modelical.com\/en\/wp-json\/wp\/v2\/tags?post=2099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}