Skip to content

Commit

Permalink
Remove need for thumbnail images
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminhwilliams committed Dec 11, 2023
1 parent cd780d6 commit 1eb0710
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions api/src/Page/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@ function _action_image() {
if ($n < sizeof($images)) {
$this->_browser_cache();
$ext = pathinfo($images[$n], PATHINFO_EXTENSION);
$file = $this->has_arg('f') ? $images[$n] : str_replace('.'.$ext, 't.'.$ext, $images[$n]);
if (file_exists($file)) {
if (file_exists($images[$n])) {
$this->app->contentType('image/'.$ext);
readfile($file);
readfile($images[$n]);
} else {
$this->_error('Not found', 'That image is no longer available');
}
Expand All @@ -161,11 +160,10 @@ function _xtal_image() {
if ($n < sizeof($images)) {
$ext = pathinfo($images[$n], PATHINFO_EXTENSION);

$file = $this->has_arg('f') ? $images[$n] : str_replace('.'.$ext, 't.'.$ext, $images[$n]);
if (file_exists($file)) {
if (file_exists($images[$n])) {
$this->_browser_cache();
$this->app->contentType('image/'.$ext);
readfile($file);
readfile($images[$n]);

} else {
$this->_error('Not found', 'That image is no longer available');
Expand Down

0 comments on commit 1eb0710

Please sign in to comment.