Welcome to BLOGical Thoughts
Friday, 1 July, 2016
I have been asked how I adjust the photos I take so they can be displayed on a web page. The photos I take are 3264 X 1840 or are 3648 X 2736 pixels. Those two sizes are way too big to display on a web page, so I use a couple of Linux command line utilities to adjust them. One of the packages I installed is called ImageMagick, which is a set of command line utilities that allow you to create, edit and compose bitmap images. The other package is called mozjpeg, which allows JPEG images to be reduced in size so they may be loaded faster.
Here is how I use the programs.
- Change to Directory Containing Photos - 'cd public_html/phuddy_duddies/photos/cinderella_custom/'
- Change Image Resolution - 'mogrify -resize 1024x768 *.JPG'
- Create Thumbnail Images - 'convert -resize 240x180 *.JPG IMG.thumbnail.JPG'
- Compress JPEG Images - '~/mozjpeg.sh JPG'
Note that to do the compression, I use a shell script called 'mozjpeg.sh' that is in my home directory. Here is the script.
# mozjpeg.sh - Compress JPEG files using mozjpeg
# author: M Burton
# written: 28 Apr 2015
printf "Syntax:\n mozjpeg.sh JPG\nor\n mozjpeg.sh jpg\n\n"
printf "mozjpeg.sh - Compress JPEG files\n\n"
if [ $# != 1 ]
if [ $XTSN != "JPG" ] && [ $XTSN != "jpg" ]
ls *.$XTSN >/dev/null 2>/dev/null
if [ $? != 0 ]
printf "There are no $XTSN files in this directory. Nothing to compress.\n"
# Convert from JPG to BMP
printf "Converting $XTSN to BMP\n"
for i in *.$XTSN
/opt/mozjpeg/bin/djpeg -bmp $i >$i.BMP
# Remove the old JPG files
printf "Removing old $XTSN files\n"
# Convert from BMP to jpg
printf "Converting BMP to jpg\n"
for i in *.BMP
/opt/mozjpeg/bin/cjpeg -quality 80 $i >$i.jpg
# Remove the old BMP files
printf "Removing BMP files\n"
# Now rename from jpg to JPG
# The ren utility is from the UNIX Power Tools book
printf "Renaming *.$XTSN.BMP.jpg to *.$XTSN\n"
~/ren "*.$XTSN.BMP.jpg" "#1.$XTSN"
printf "Compression completed. $COUNTER files processed.\n\n"
As I was driving the '49 Plymouth down to the Paul Bunyon Hayden cruise last Monday, the rear window fell in. There was no damage to the window, so I can install it again, but it's obvious that I ordered the wrong rubber for that installation. I have now ordered the proper rubber for both the windshield and rear window. Just another one of those little things that prevent me from showing the car at more car shows.
Quote of the day:
Its failings notwithstanding, there is much to be said in favor of journalism in that by giving us the opinion of the uneducated, it keeps us in touch with the ignorance of the community.
Silly sign of the day:
Free/Open Source Software
- 14 Best IDEs for C++ Programming or Source Code Editors on Linux
- DuckDuckGo: The Little Search Engine That Gives Back Big
- 30 days in a terminal: Day 10 - The experiment is over
- Hands on with KaOS Linux: Not just another derivative distro
- 5 SSH Hardening Tips
- Why I'm Unlikely to Ever Return Microsoft's Love
- Giving Linux and LibreOffice a Try for Your Home Office
- Open Source Is Key to the Modern Data Center, Says EMC's Joshua Bernstein
- Can you imagine a world without open source?
- Linux Mint 18 "Sarah" Cinnamon and MATE Editions Officially Released
- Linux Under the Hood: Silence of the RAM
- Makulu's LinDoz Is a Smooth Windows-Cinnamon Blend
Security Theater/"Intellectual Property"/Big Brother
- No means no: Windows 10 nagware's red X will stop update - Microsoft
- Google Found Disastrous Symantec and Norton Vulnerabilities That Are 'As Bad As It Gets'
- DMCA Notices Nuke 8,268 Projects on Github
- Even Congress Is Slamming That Crummy Crypto Bill
- Leaked FBI documents reveal secret rules for spying on journalists with National Security Letters
- Comcast Admits It Incorrectly Debited $1,775 From Account, Tells Me To Sort It Out With Bank
- Why Twitter Can't Even Protect Tech CEOs From Getting Hacked
- I'm a former Marine who was on the no-fly list for 4 years - and I still don't know why
- HP awarded $3B in damages from Oracle over Itanium database cancelation
- MPAA's Domain Name 'Policing' Results in First Suspensions