~jheckt/PhotographyWebsite

b89fb0f8fb8032ba8537432a319817b24e459116 — jheckt 1 year, 10 months ago 25c5035
Added shutter speed, f-stop, iso to photo page.
2 files changed, 14 insertions(+), 0 deletions(-)

M html/photo.html
M photos.go
M html/photo.html => html/photo.html +2 -0
@@ 26,6 26,8 @@
    <h5 style="display: inline;">{{ .CameraModel }}</h5>
    <br>
    <h5 style="display: inline;">{{ .Details }}</h5>
    <br>
    <h5 style="display: inline;">{{ .PhotoTech }}</h5>
    <br><br>
    {{ .Desc }}
</div>

M photos.go => photos.go +12 -0
@@ 21,6 21,7 @@ type Photo struct {
	PhotoDate   string        // Date of photo
	Details     string        // Lens, fstop, ISO, etc
	CameraModel string        // Camera model
	PhotoTech   string        // Photo technical information  (e.g. shutter speed, aperture, focal length, etc)
	LowRezLoc   string        // Where the image is stored for the <img> tag for easy displaying
	HighRezLoc  string        // Where the image is stored for the <img> tag for high res requests
	AverageLoc  string        // Where the averages palette is stored for the <img> tag


@@ 72,6 73,7 @@ func generatePhotoPage(collection string, filename string) (*template.Template, 
		PhotoDate:   "No date available",
		Details:     "No lens information",
		CameraModel: "No camera information",
		PhotoTech:   "",
		LowRezLoc:   fmt.Sprintf("/collections/%s/%s.jpg", collection, filename),
		HighRezLoc:  fmt.Sprintf("/collections/%s/%s.png", collection, filename),
		AverageLoc:  fmt.Sprintf("/collections/%s/%s", collection, fmt.Sprintf("%s.png.average.png", filename))}


@@ 98,6 100,16 @@ func generatePhotoPage(collection string, filename string) (*template.Template, 
		if exif[0]["DateTimeOriginal"] != nil {
			photo.PhotoDate = exif[0]["DateTimeOriginal"].(string)
		}

		if exif[0]["ExposureTime"] != nil {
			photo.PhotoTech = fmt.Sprintf("%s %s ", photo.PhotoTech, exif[0]["ExposureTime"].(string))
		}
		if exif[0]["FNumber"] != nil {
			photo.PhotoTech = fmt.Sprintf("%s f/%.1f ", photo.PhotoTech, exif[0]["FNumber"].(float64))
		}
		if exif[0]["ISO"] != nil {
			photo.PhotoTech = fmt.Sprintf("%s %.0f ", photo.PhotoTech, exif[0]["ISO"].(float64))
		}
	}

	// Load the photo page template