Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -230,6 +230,8 @@ Filter
|
||||
$return[] = 'image_album_id';
|
||||
$return[] = 'image_copyright';
|
||||
$return[] = 'image_nsfw';
|
||||
$return[] = 'image_media';
|
||||
$return[] = 'image_file_type';
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -279,7 +281,27 @@ Filter
|
||||
return array();
|
||||
}
|
||||
|
||||
return is_array( $this->_data['metadata'] ) ? $this->_data['metadata'] : ( $this->_data['metadata'] ? json_decode( $this->_data['metadata'], TRUE ) : array() );
|
||||
/* Did we disable metadata viewing? */
|
||||
if( Settings::i()->gallery_metadata == static::IMAGE_METADATA_NONE )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$metadata = is_array( $this->_data['metadata'] ) ? $this->_data['metadata'] : ( $this->_data['metadata'] ? json_decode( $this->_data['metadata'], TRUE ) : array() );
|
||||
|
||||
/* If we're stripping sensitive data, then remove it here */
|
||||
if( Settings::i()->gallery_metadata == static::IMAGE_METADATA_NOSENSITIVE )
|
||||
{
|
||||
foreach( $metadata as $k => $v )
|
||||
{
|
||||
if( str_starts_with( $k, 'GPS.' ) )
|
||||
{
|
||||
unset( $metadata[ $k ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,10 +314,9 @@ Filter
|
||||
if( isset( $this->_data['data'] ) )
|
||||
{
|
||||
$data = is_array( $this->_data['data'] ) ? $this->_data['data'] : json_decode( $this->_data['data'], true );
|
||||
return is_array( $data ) ? $data : [];
|
||||
}
|
||||
|
||||
return [];
|
||||
return $data ?? [ 'large' => [ null, null ], 'small' => [ null, null ] ];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,7 +337,17 @@ Filter
|
||||
*/
|
||||
public function get__notes(): array
|
||||
{
|
||||
return is_array( $this->_data['notes'] ) ? $this->_data['notes'] : ( $this->_data['notes'] ? json_decode( $this->_data['notes'], TRUE ) : array() );
|
||||
if( is_array( ( $this->_data['notes'] ) ) )
|
||||
{
|
||||
return $this->_data['notes'];
|
||||
}
|
||||
|
||||
if( isset( $this->_data['notes'] ) and $data = json_decode( $this->_data['notes'], true ) )
|
||||
{
|
||||
return $data;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1587,6 +1618,23 @@ Filter
|
||||
return $image;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Metadata-related constants
|
||||
*/
|
||||
const IMAGE_METADATA_NONE = 0;
|
||||
const IMAGE_METADATA_ALL = 1;
|
||||
const IMAGE_METADATA_NOSENSITIVE = 2;
|
||||
|
||||
/**
|
||||
* Determines if the map and location data should be displayed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function showLocation() : bool
|
||||
{
|
||||
return GeoLocation::enabled() and Settings::i()->gallery_metadata == static::IMAGE_METADATA_ALL and $this->gps_show;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the map for the image if available
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user