mirror of
https://github.com/mosbth/cimage.git
synced 2025-07-30 21:20:11 +02:00
Check if constants exists. Fix #42
This commit is contained in:
@@ -1735,7 +1735,12 @@ class CImage
|
||||
$details['height'] = $this->height;
|
||||
$details['aspectRatio'] = round($this->width / $this->height, 3);
|
||||
|
||||
return json_encode($details, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
|
||||
$options = null;
|
||||
if (defined("JSON_PRETTY_PRINT") && defined("JSON_UNESCAPED_SLASHES")) {
|
||||
$options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES;
|
||||
}
|
||||
|
||||
return json_encode($details, $options);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user