Coding

PHP exifTool

Here is a great example of Php array code using Exiftool. This shows how to dump ExifTool Tag Names into an array. I moved this from my old blog if it looks familiar. I have used this on my own site, and it works great!

*==========================================================================
	read exif from exiftool from image into raw array
	two different ways to do it here depending on what you like
============================================================================*/
//exec('exiftool -s ' . '"' . $path_to_image . '"', $exif_raw_array);   
// note the -s flag returns tags with no spaces -n removes data formatting will work with either or none

exec('exiftool -s -n -Orientation -ImageWidth -ImageHeight -Title -ImageDescription -Keywords -Copyright -Artist -Make -Model -LensModel -FocalLength -FocalLengthIn35mmFormat -ShutterSpeedValue -ApertureValue -ISO -DateTimeOriginal -City -State -Country -Location -GPSSpeed -GPSAltitude -GPSLatitude -GPSLongitude ' . '"' . $path_to_image . '"', $exif_raw_array);

/*==========================================================================
	extract tagname and tagname value from raw array
============================================================================*/
// note var_dump(exif_raw_array) to visualize what needs to be done
foreach ($exif_raw_array as $key => $value)  {
	
$string_length_of_value_field = strlen($value); // need string length for calculation below
$position_of_colon = strpos($value, ':'); //get the position of the colon to use in calculation below


$exiftool_tagname = substr($value, 0, $position_of_colon); // shorten the full string starting at position 0 and ending at the colon
$exiftool_tagname = ltrim($exiftool_tagname); // trim any white space on the left that may exist
$exiftool_tagname = rtrim($exiftool_tagname); // trim any white space on the right that may exist
// done - now have $exiftool_tagname extracted by itself


// same technique as above just extracting the other end of the string
$exiftool_tagname_value = substr($value, ($position_of_colon+1), ($string_length_of_value_field-$position_of_colon));
$exiftool_tagname_value = ltrim($exiftool_tagname_value);
$exiftool_tagname_value = rtrim($exiftool_tagname_value);
// done - now have $exiftool_tagname_value extracted by itself


/*==========================================================================
	enter variables into exiftool_final_array with predictable fields
============================================================================*/
$exiftool_final_array[$exiftool_tagname] = $exiftool_tagname_value;


/*==========================================================================
	end of exif_raw_array loop
============================================================================*/
}

/*==========================================================================
	destroy exif_raw_array - no need to keep in memory
============================================================================*/
unset($exif_raw_array);
/*==========================================================================
	done - new clean array is ready to use - try var_dump($exiftool_final_array)
	to see
============================================================================*/

SmugMug SEO The Problem and The Solution

A lot has been written about SmugMug SEO. I like SmugMug and will continue to use them. They are a great deal for image delivery. They are not trying to be anything else. They are never going to be your perfect place for each of your images to get correctly indexed by Google. You will get a few images indexed. They are a great service and will continue to be. I used them for years as a working professional to deliver images to clients. They are perfect for what they say they are. SmugMug SEO is fine for what SmugMug says they do.

Google does not index every page and every image of every site. Period. End of story. No amount of SmugMug SEO will fix this. But, if you want to optimize coverage by Google, and want to control the meta tags, filenames and whatnot, then build and host your own site. No image hosting platform will allow you complete control of this. There are many software packages online and off where you can build each page of your site with perfect SEO page titles, meta names, image filenames and all the other necessary ingredients. I did this and I am seeing good results so far. I hand-coded my own site to link back to my SmugMug site. It onIy exists to index my images. I don't have to handwrite every page. I just write server side code to produce each page for each image on the fly according to my own specifications. My pages are very simple by choice. It was not meant to be a beautiful site. No extra fluff. It works great on mobile devices, which Google prefers.

I once had over a 1000 images online for many years. I took a leap of faith and deleted all of them. I then removed them from Google using Google's tools. I then went back through my entire image catalog and reposted every image that I wanted reposted. The benefit of doing this was to properly title, caption, keyword and write metadata for each and every image accurately and correctly. It was fun to revisit old images and re-edit raw files. I laughed at myself sometimes when I saw how I edited something 20 years ago.

Give SmugMug a break, they are awesome. SmugMug SEO is a bit of an unfair witch hunt. If you can do better, then do it. I did.

Leonard Knight Salvation Mountain

I met Leonard Knight several times a few years before his death in 2014. He allowed me to shoot a few portraits of him. He struck me as a generous and caring individual. All he wanted to do was show me his mountain and let me know that Jesus loved me. If you have never been to Salvation Mountain, then I encourage you to visit. It is amazing what this man built. I don’t know what kind of condition it is in today. Hopefully someone is keeping it in good shape.

Tag Name Data
Title Leonard Knight Salvation Mountain
Keywords Leonard Knight, niland, salton sea, salvation mountain, slab city
Copyright ©ExpertPhoto.com All Rights Reserved
Artist ExpertPhoto.com
Make Canon
Camera Model Name Canon EOS 5D Mark II
Lens Model EF50mm f/1.4 USM
Focal Length 50.00mm
Shutter Speed Value 1/1600 second
Aperture Value 4.00
ISO 100
Date/Time Original Wednesday December 30, 2009 02:08pm
City Calipatria
State California
Country United States
Location Salvation Mountain
GPS Altitude 2 meters (6.6 feet) above sea level
GPS Latitude 33.25422
GPS Longitude -115.47336
Map Google Map Link