summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-24 20:42:13 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-24 20:42:13 +0100
commit67587e23f293dc5fa3242a6e221eeaeff624297c (patch)
tree86fe73bbec75eda0217e2bd87318df0cfa0c61b5
parentb61dddb5aba46811056dedade397fb074e58c432 (diff)
downloadfisheye-67587e23f293dc5fa3242a6e221eeaeff624297c.tar.gz
fisheye-67587e23f293dc5fa3242a6e221eeaeff624297c.tar.bz2
fisheye-67587e23f293dc5fa3242a6e221eeaeff624297c.zip
Ignore Sony DSC placeholder in EXIF ImageDescription
Sony cameras write 'SONY DSC' (padded with spaces) into ImageDescription, which was being copied as the image title. Trim and skip this value so filename-derived titles are used instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rwxr-xr-xincludes/classes/FisheyeImage.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/includes/classes/FisheyeImage.php b/includes/classes/FisheyeImage.php
index c2a1a25..c26cedd 100755
--- a/includes/classes/FisheyeImage.php
+++ b/includes/classes/FisheyeImage.php
@@ -212,13 +212,16 @@ class FisheyeImage extends FisheyeBase {
// Set some default values based on the Exif data
if( !empty( $exifHash['IFD0']['ImageDescription'] ) ) {
- if( empty( $pParamHash['title'] ) ) {
- $exifTitle = trim( $exifHash['IFD0']['ImageDescription'] );
- if( !empty( $exifTitle ) ) {
- $pParamHash['title'] = $exifTitle;
+ $exifDesc = trim( $exifHash['IFD0']['ImageDescription'] );
+ // Sony cameras stamp 'SONY DSC' into ImageDescription — ignore it
+ if( $exifDesc !== 'SONY DSC' ) {
+ if( empty( $pParamHash['title'] ) ) {
+ if( !empty( $exifDesc ) ) {
+ $pParamHash['title'] = $exifDesc;
+ }
+ } elseif( empty( $pParamHash['edit'] ) && !$this->getField( 'data' ) && $pParamHash['title'] != $exifDesc ) {
+ $pParamHash['edit'] = $exifDesc;
}
- } elseif( empty( $pParamHash['edit'] ) && !$this->getField( 'data' ) && $pParamHash['title'] != $exifHash['IFD0']['ImageDescription'] ) {
- $pParamHash['edit'] = $exifHash['IFD0']['ImageDescription'];
}
}