[HowTo] Automation – Photo resizing script

  • Prerequisites:
    • Mac Portshttps://www.macports.org/
      • Apple’s Command Line Developer Tools
      • type in the following command to get Apple’s Command Line Developer Tools installed:
xcode-select --install
  • If you get the following message about xcode-select command requiring command line developer tools, go ahead and install
  • Apple’s Xcode Developer Tools
xcodebuild -license
sudo port -v selfupdate
  • Now Mac Ports has been installed on your Mac
  • Go ahead and close your terminals and open a new terminal window
  • ImageMagick:
sudo port install perl5.34
sudo port install imagemagick
sudo port install p5.34-perlmagick
% sudo port install perl5.34
---> Computing dependencies for perl5.34
The following dependencies will be installed:
db48
gdbm
gettext-runtime
libiconv
ncurses
readline
Continue? [Y/n]: Y
.....
% sudo port install imagemagick
---> Computing dependencies for ImageMagick
The following dependencies will be installed:
aom
bash
brotli
bzip2
cairo
coreutils
dav1d
djvulibre
expat
fftw-3
fontconfig
freetype
gdk-pixbuf2
ghostscript
giflib
glib2
gmp
gobject-introspection
icu
imath
jasper
jbig2dec
jbigkit
kvazaar
lcms2
lerc
libde265
libdeflate
libedit
libelf
libffi
libgcc
libgcc14
libheif
libidn
libjpeg-turbo
libpaper
libpixman
libpng
libraw
libtool
libxml2
lz4
m4
mpdecimal
openexr
openh264
openjpeg
openssl
openssl3
pcre2
perl5
pkgconfig
py313-mako
py313-markdown
py313-markupsafe
py313-setuptools
python313
python3_select
python3_select-313
python_select
python_select-313
shared-mime-info
sqlite3
svt-av1
tiff
urw-fonts
webp
x265
xorg-libX11
xorg-libXau
xorg-libXdmcp
xorg-libXext
xorg-libXt
xorg-libice
xorg-libsm
xorg-libxcb
xorg-xcb-proto
xorg-xcb-util
xorg-xorgproto
xrender
xz
zlib
zstd
Continue? [Y/n]: Y
....
---> Some of the ports you installed have notes:
coreutils has the following notes:
The tools provided by GNU coreutils are prefixed with the character 'g' by
default to distinguish them from the BSD commands.
For example, cp becomes gcp and ls becomes gls.

If you want to use the GNU tools by default, add this directory to the front
of your PATH environment variable:
/opt/local/libexec/gnubin/
libheif has the following notes:
Support for rav1e now disabled by default; enable via +rav1e
libidn has the following notes:
GNU libidn2 is the successor of GNU libidn. It comes with IDNA 2008 and TR46
implementations and also provides a compatibility layer for GNU libidn.
python313 has the following notes:
To make this the default Python or Python 3 (i.e., the version run by the
'python' or 'python3' commands), run one or both of:

sudo port select --set python python313
sudo port select --set python3 python313
shared-mime-info has the following notes:
A startup item has been generated that will start shared-mime-info with
launchd, and will be enabled automatically on activation. Execute the
following command to manually _disable_ it:

sudo port unload shared-mime-info
  • Depends on which version of Python 3 gets installed/available, you may want to set the default version of Python by running the ‘select -set’ commands at the bottom of the install
sudo port install p5.34-perlmagick
sudo port install p5.34-image-exiftool
% sudo port install p5.34-image-exiftool
---> Computing dependencies for p5.34-image-exiftool
---> Fetching archive for p5.34-image-exiftool
---> Attempting to fetch p5.34-image-exiftool-13.300.0_0.darwin_any.noarch.tbz2 from https://packages.macports.org/p5.34-image-exiftool
---> 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
---> Installing p5.34-image-exiftool @13.300.0_0
---> Activating p5.34-image-exiftool @13.300.0_0
---> Cleaning p5.34-image-exiftool
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
sudo port install wget
% sudo port install wget
---> Computing dependencies for wget
The following dependencies will be installed:
curl-ca-bundle
gnutls
gsettings-desktop-schemas
libidn2
libproxy
libpsl
libtasn1
libunistring
libxslt
nettle
p11-kit
Continue? [Y/n]: Y
% cd ~/Downloads
% wget https://www.sentex.ca/~mwandel/jhead/os-x/jhead
--2025-05-26 15:24:31-- https://www.sentex.ca/~mwandel/jhead/os-x/jhead
Resolving www.sentex.ca (www.sentex.ca)... 64.7.148.55
Connecting to www.sentex.ca (www.sentex.ca)|64.7.148.55|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 72696 (71K)
Saving to: ‘jhead’

jhead 100%[===================>] 70.99K 291KB/s in 0.2s

2025-05-26 15:24:32 (291 KB/s) - ‘jhead’ saved [72696/72696]
% sudo cp ~/Downloads/jhead /opt/local/bin/
% sudo chmod +x /opt/local/bin/jhead
  • close all Terminal windows and restart a new one to test:
% cd ~/Pictures
% % ./scripts/raw2jpeg.pl -h
Unknown option: h
-F- Unknown option encountered.
-F- Availabel options : tn, bw, op, cc, SV, AV, SSP, title, desc, src, desc, move & debug
-F- -src : Location for Source imgs(jpeg)
-F- -dest : Location for Destination
-F- -SV : Generate SimpleView Web contents.
-F- -AV : Generate ActiveView Web contents.
-F- -SSP : Generate SlideShowPro Web contents.
-F- -3W : Triple Width 1800x600
-F- -title : Web Title for SV/AV/SSP.
-F- -desc : Web Description for SV/AV/SSP.
-F- -tn : Generate Thumbnail size.
-F- -bw : Generate Grayscale images(800x).
-F- -pr : Generate Polaroid images(800x).
-F- -op : Generate OilPaint images(800x).
-F- -cc : Generate Charcoal images(800x).
-F- -bdr : Generate Bordered/framed images(800x).
  • Sample runs:
  • Let’s assume that the photos are arranged in ~/Pictures folder with <date>_<title> and scripts are also in ~/Pictures folder as above
% cd ~/Pictures
% % ./scripts/raw2jpeg.pl -SSP -AV -SV -bw -src 20250525_Friday-Party/uncompressed -dest 20250525_Friday-Party -title 20250525_Friday-Party
  • (Here, you can use auto-completion by pressing <tab> key after 20250525…)

Android OS Korean MP3 Tag fix

I enjoy listening Korean Song on the Smart phones but most of the times, when I transfer MP3s onto Android OS Smart Phones, the Korean in the Mp3 Tags are all broken….

I discovered that it is cause by the MP3 Tag Version and the easy fix is to re-write the MP3 Tags with the correct(?) version.

If you re-write the MP3 Tags with ID3v2.4, the problem goes away~

I find Mp3tag is good enough and easy to use for this fix.

MP3Tag fix #1

MP3Tag Fix #2

MP3Tag Fix #3

Hasselblad H3DII-39 Digital Back on H1/H2 Test

The Hasselblad H3DII-39 digital back is just awesome!!!!  and this back can be used on other large format cameras with proper adapter and firewire power supply.

Someone from slrclub.com was wondering if H3D digital back can be fitted on H2 body and that made me wonder… what if I supply power via Firewire onto the back, it should work!!!  So I put that into the test.

H3DII39onH2

H3DII39onH2

So this is the setup – H3DII-39 digital back on H2(H1 upgrade) body!  I powered the back with Firewire800 and turn the power on the H2 Body:

H3DII39onH2 - message on the back

H3DII39onH2 – message on the back

H3DII39onH2 - message on the body

H3DII39onH2 – message on the body

H3DII39onH2 - power via Firewire800

H3DII39onH2 – power via Firewire800

 

The outcome prove that my guess was wrong….  Either H1/H2 body is saying “I am H1/H2” to the back or the back is somehow figuring out that it is attached to H1/H2…

So the last test was to see if the H3DII-39 digital back can operate by itself:

H3DII39onH2 - Back itself

H3DII39onH2 – Back itself

Yeah, it works by itself so if it is attached to large format camera with an adapter and the sync cord, it will operate just fine.

Update 2013/02/04
I was told that actually this can do done if I cover the contacts on the back(or on the body) and use the sync cord and setting the digital back as the “view camera mode”.  I should try this out when I get a chance…

 

Hasselblad H-series Digital Back File Counter Reset

I found this document from HasselbladDigitalForum.com and I may want to use it later.

Not the actuation reset(cannot be done) but the file name counter reset by this document.

Hasselblad Digital Back File Counter Reset

(The above original link is no longer working…)

Hasselblad Digital Forum -> Main Board -> Tips and Tricks

https://www.hasselbladdigitalforum.com/index.php/board,9.0.html

H3DII-39, How I can change the raw-name:

https://www.hasselbladdigitalforum.com/index.php/topic,822.msg4291.html#msg4291

November 26, 2009, 09:36:28 AMLast Edit: September 16, 2010, 09:35:16 AM by HLArt

Here is the how to do: “Go in the back menue to the point “settings” then push the button “Info” and the button “arrow to right”, to the same time, or in succession, in the next menue the menue spring automaticliy, scroll down, you will find there a new entire down the last place, that called “service”, enter there and scroll down to the point “reset lifecounter”. It set the counter to “0”. I take my CF-card into the laptop and type with texteditor the number I want to have as next in my conter and then I put it into my Cam, to do the next shot. And you`ll see its no wonder, the right figure you will see on your backscreen.
Kr Hörbi

AF Focus Test Charts

I have to say that I was never happy with my Nikkor 85mm F/1.4 AF-D lens outputs.  After using it on D800E and D3, I was sure that its AF is off – back-focusing….  So I looked for some good AF Focus Test Charts on the internet and found some.

http://regex.info/blog/photo-tech/focus-chart

http://www.bealecorner.com/trv900/respat/

http://focustestchart.com/focus21.pdf

I must say that I am rather disappointed with the results of my AF testing on all of my current Nikkor lenses.  Only one lens is spot on and the rest needs some AF Tuning on the both cameras.  For some reason, they all experiences back-focusing and none with front-focusing…

AF Focus Test Chart #1

 

Focus Test Chart Instruction PDF