{"id":551,"date":"2025-05-26T14:39:13","date_gmt":"2025-05-26T22:39:13","guid":{"rendered":"https:\/\/www.yootopia.com\/mystory\/wp\/?p=551"},"modified":"2025-05-26T14:39:13","modified_gmt":"2025-05-26T22:39:13","slug":"howto-automation-photo-resizing-script","status":"publish","type":"post","link":"http:\/\/www.yootopia.com\/mystory\/wp\/?p=551","title":{"rendered":"[HowTo] Automation &#8211; Photo resizing script"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li><strong>Prerequisites<\/strong>:\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Mac Ports<\/strong> &#8211; <a href=\"https:\/\/www.macports.org\/\">https:\/\/www.macports.org\/<\/a>\n<ul class=\"wp-block-list\">\n<li>Apple&#8217;s Command Line Developer Tools<\/li>\n\n\n\n<li>type in the following command to get Apple&#8217;s Command Line Developer Tools installed:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">xcode-select --install<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you get the following message about xcode-select command requiring command line developer tools, go ahead and install<\/li>\n\n\n\n<li>Apple&#8217;s Xcode Developer Tools<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1146\" height=\"614\" src=\"https:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.11-PM.jpg\" alt=\"\" class=\"wp-image-553\" srcset=\"http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.11-PM.jpg 1146w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.11-PM-600x321.jpg 600w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.11-PM-768x411.jpg 768w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.11-PM-500x268.jpg 500w\" sizes=\"auto, (max-width: 1146px) 100vw, 1146px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"480\" src=\"https:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.22-PM-1200x480.jpg\" alt=\"\" class=\"wp-image-555\" srcset=\"http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.22-PM-1200x480.jpg 1200w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.22-PM-600x240.jpg 600w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.22-PM-768x307.jpg 768w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.22-PM-500x200.jpg 500w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.22-PM.jpg 1220w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">xcodebuild -license<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Download and install Mac Ports package &#8211; <a href=\"https:\/\/www.macports.org\/install.php\">https:\/\/www.macports.org\/install.php<\/a><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"911\" src=\"https:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.09-PM-1200x911.jpg\" alt=\"\" class=\"wp-image-552\" srcset=\"http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.09-PM-1200x911.jpg 1200w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.09-PM-600x456.jpg 600w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.09-PM-768x583.jpg 768w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.09-PM-395x300.jpg 395w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Image-5-26-25-at-2.09-PM.jpg 1464w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo port -v selfupdate<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Now Mac Ports has been installed on your Mac<\/li>\n\n\n\n<li>Go ahead and close your terminals and open a new terminal window<\/li>\n\n\n\n<li><strong>ImageMagick<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo port install perl5.34<br>sudo port install imagemagick<br>sudo port install p5.34-perlmagick<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">% sudo port install perl5.34<br>--->  Computing dependencies for perl5.34<br>The following dependencies will be installed: <br> db48<br> gdbm<br> gettext-runtime<br> libiconv<br> ncurses<br> readline<br>Continue? [Y\/n]: Y<br>.....<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">% sudo port install imagemagick<br>--->  Computing dependencies for ImageMagick<br>The following dependencies will be installed: <br> aom<br> bash<br> brotli<br> bzip2<br> cairo<br> coreutils<br> dav1d<br> djvulibre<br> expat<br> fftw-3<br> fontconfig<br> freetype<br> gdk-pixbuf2<br> ghostscript<br> giflib<br> glib2<br> gmp<br> gobject-introspection<br> icu<br> imath<br> jasper<br> jbig2dec<br> jbigkit<br> kvazaar<br> lcms2<br> lerc<br> libde265<br> libdeflate<br> libedit<br> libelf<br> libffi<br> libgcc<br> libgcc14<br> libheif<br> libidn<br> libjpeg-turbo<br> libpaper<br> libpixman<br> libpng<br> libraw<br> libtool<br> libxml2<br> lz4<br> m4<br> mpdecimal<br> openexr<br> openh264<br> openjpeg<br> openssl<br> openssl3<br> pcre2<br> perl5<br> pkgconfig<br> py313-mako<br> py313-markdown<br> py313-markupsafe<br> py313-setuptools<br> python313<br> python3_select<br> python3_select-313<br> python_select<br> python_select-313<br> shared-mime-info<br> sqlite3<br> svt-av1<br> tiff<br> urw-fonts<br> webp<br> x265<br> xorg-libX11<br> xorg-libXau<br> xorg-libXdmcp<br> xorg-libXext<br> xorg-libXt<br> xorg-libice<br> xorg-libsm<br> xorg-libxcb<br> xorg-xcb-proto<br> xorg-xcb-util<br> xorg-xorgproto<br> xrender<br> xz<br> zlib<br> zstd<br>Continue? [Y\/n]: Y<br>....<br>--->  Some of the ports you installed have notes:<br>  coreutils has the following notes:<br>    The tools provided by GNU coreutils are prefixed with the character 'g' by<br>    default to distinguish them from the BSD commands.<br>    For example, cp becomes gcp and ls becomes gls.<br>    <br>    If you want to use the GNU tools by default, add this directory to the front<br>    of your PATH environment variable:<br>        \/opt\/local\/libexec\/gnubin\/<br>  libheif has the following notes:<br>    Support for rav1e now disabled by default; enable via +rav1e<br>  libidn has the following notes:<br>    GNU libidn2 is the successor of GNU libidn. It comes with IDNA 2008 and TR46<br>    implementations and also provides a compatibility layer for GNU libidn.<br>  python313 has the following notes:<br>    To make this the default Python or Python 3 (i.e., the version run by the<br>    'python' or 'python3' commands), run one or both of:<br>    <br>        sudo port select --set python python313<br>        sudo port select --set python3 python313<br>  shared-mime-info has the following notes:<br>    A startup item has been generated that will start shared-mime-info with<br>    launchd, and will be enabled automatically on activation. Execute the<br>    following command to manually _disable_ it:<br>    <br>        sudo port unload shared-mime-info<br><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Depends on which version of Python 3 gets installed\/available, you may want to set the default version of Python by running the &#8216;select -set&#8217; commands at the bottom of the install<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo port install p5.34-perlmagick<br>sudo port install p5.34-image-exiftool<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">% sudo port install p5.34-image-exiftool<br>--->  Computing dependencies for p5.34-image-exiftool<br>--->  Fetching archive for p5.34-image-exiftool<br>--->  Attempting to fetch p5.34-image-exiftool-13.300.0_0.darwin_any.noarch.tbz2 from https:\/\/packages.macports.org\/p5.34-image-exiftool<br>--->  Attempting to fetch p5.34-image-exiftool-13.300.0_0.darwin_any.noarch.tbz2.rmd160 from https:\/\/packages.macports.org\/p5.34-image-exiftool<br>--->  Installing p5.34-image-exiftool @13.300.0_0<br>--->  Activating p5.34-image-exiftool @13.300.0_0<br>--->  Cleaning p5.34-image-exiftool                      <br>--->  Scanning binaries for linking errors<br>--->  No broken files found.<br>--->  No broken ports found.<br><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Exif Jpeg header manipulation tool &#8211; <a href=\"https:\/\/www.sentex.ca\/~mwandel\/jhead\/\">https:\/\/www.sentex.ca\/~mwandel\/jhead\/<\/a><\/li>\n\n\n\n<li>download MacOS version of jhead and install it in \/opt\/local\/bin<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo port install wget<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">% sudo port install wget<br>--->  Computing dependencies for wget<br>The following dependencies will be installed: <br> curl-ca-bundle<br> gnutls<br> gsettings-desktop-schemas<br> libidn2<br> libproxy<br> libpsl<br> libtasn1<br> libunistring<br> libxslt<br> nettle<br> p11-kit<br>Continue? [Y\/n]: Y<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">% cd ~\/Downloads<br>% wget  https:\/\/www.sentex.ca\/~mwandel\/jhead\/os-x\/jhead<br>--2025-05-26 15:24:31--  https:\/\/www.sentex.ca\/~mwandel\/jhead\/os-x\/jhead<br>Resolving www.sentex.ca (www.sentex.ca)... 64.7.148.55<br>Connecting to www.sentex.ca (www.sentex.ca)|64.7.148.55|:443... connected.<br>HTTP request sent, awaiting response... 200 OK<br>Length: 72696 (71K)<br>Saving to: \u2018jhead\u2019<br><br>jhead               100%[===================>]  70.99K   291KB\/s    in 0.2s    <br><br>2025-05-26 15:24:32 (291 KB\/s) - \u2018jhead\u2019 saved [72696\/72696]<br><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">% sudo cp ~\/Downloads\/jhead \/opt\/local\/bin\/<br>% sudo chmod +x \/opt\/local\/bin\/jhead<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>close all Terminal windows and restart a new one to test:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">% cd ~\/Pictures<br>% % .\/scripts\/raw2jpeg.pl -h<br>Unknown option: h<br>-F- Unknown option encountered.<br>-F- Availabel options : tn, bw, op, cc, SV, AV, SSP, title, desc, src, desc, move &amp; debug<br>-F-\t-src   : Location for Source imgs(jpeg)<br>-F-\t-dest  : Location for Destination<br>-F-\t-SV    : Generate SimpleView Web contents.<br>-F-\t-AV    : Generate ActiveView Web contents.<br>-F-\t-SSP   : Generate SlideShowPro Web contents.<br>-F-\t-3W    : Triple Width 1800x600<br>-F-\t-title : Web Title for SV\/AV\/SSP.<br>-F-\t-desc  : Web Description for SV\/AV\/SSP.<br>-F-\t-tn    : Generate Thumbnail size.<br>-F-\t-bw    : Generate Grayscale images(800x).<br>-F-\t-pr    : Generate Polaroid images(800x).<br>-F-\t-op    : Generate OilPaint images(800x).<br>-F-\t-cc    : Generate Charcoal images(800x).<br>-F-\t-bdr   : Generate Bordered\/framed images(800x).<br><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Sample runs:<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"670\" src=\"https:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-26-at-3.34.40-PM-1200x670.png\" alt=\"\" class=\"wp-image-563\" srcset=\"http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-26-at-3.34.40-PM-1200x670.png 1200w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-26-at-3.34.40-PM-600x335.png 600w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-26-at-3.34.40-PM-768x429.png 768w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-26-at-3.34.40-PM-1536x857.png 1536w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-26-at-3.34.40-PM-2048x1143.png 2048w, http:\/\/www.yootopia.com\/mystory\/wp\/wp-content\/uploads\/2025\/05\/Screenshot-2025-05-26-at-3.34.40-PM-500x279.png 500w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Let&#8217;s assume that the photos are arranged in ~\/Pictures folder with &lt;date>_&lt;title> and scripts are also in ~\/Pictures folder as above<\/li>\n\n\n\n<li><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">% cd ~\/Pictures<br>% % .\/scripts\/raw2jpeg.pl -SSP -AV -SV -bw -src 20250525_Friday-Party\/uncompressed -dest 20250525_Friday-Party -title 20250525_Friday-Party<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>(Here, you can use auto-completion by pressing &lt;tab> key after 20250525&#8230;)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>xcode-select &#8211;install xcodebuild -license sudo port -v selfupdate sudo port install perl5.34sudo port install imagemagicksudo port install p5.34-perlmagick % sudo port install perl5.34&#8212;> Computing dependencies for perl5.34The following dependencies will be installed: db48 gdbm gettext-runtime libiconv ncurses readlineContinue? [Y\/n]: Y&#8230;.. &hellip; <a href=\"http:\/\/www.yootopia.com\/mystory\/wp\/?p=551\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[31,128,129,19,3,1],"tags":[130,85,74,104,32,131],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-apple_os_x","category-automation","category-automation-scripting","category-howto","category-photography","category-uncategorized","tag-automation","tag-howto","tag-mac","tag-macos","tag-osx","tag-scripting"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p48Rtg-8T","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=551"}],"version-history":[{"count":9,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":564,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=\/wp\/v2\/posts\/551\/revisions\/564"}],"wp:attachment":[{"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yootopia.com\/mystory\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}