limit the size of zoom

Permalink
I have a high-res file of about 4000 x 3000 px but I want only the zoom to go 800px.

Is there a way to do this other than physically resizing the image.

View Replies:
Remo replied on at Permalink Reply
Remo
You could create a custom template and restrict the size of both images. Do you have some basic PHP skills? All the code you need to change is herehttps://github.com/Remo/concrete5-zoom-image/blob/master/blocks/zoom...
aleamio replied on at Permalink Reply
I don't have.

I managed to manipulate php's like, footer, header by using the browser's inspect element and searching the web for the codes.

But if you can give me a bit more details just to give a lead, that will be appreciated.
Remo replied on at Permalink Reply
Remo
Sorry, took me a while to get back to you, things are a bit hectic right now. Not enough unemployed people..

I think it should work if you copy /packages/zoom_image/blocks/zoom_image/view.php to /blocks/zoom_image/view.php (you probably have to create the directories too!) and then modify the file to make it look like this:

<?php
defined('C5_EXECUTE') or die('Access Denied.');
$version_arr = explode('.', APP_VERSION);
if ($version_arr[1] < 2)
    die("This block doesn't support concrete" . APP_VERSION);
if ($version_arr[1] == 2) {
    $fo = $controller->getAssetFileObject();
    $fileName = $fo->getFileRelativePath();
    $thumbnail = $fo->getThumbnail(intval($controller->thumbnailWidth), intval($controller->thumbnailHeight));
} else {
    $ih = Loader::helper('image');
    $fo = $controller->getFileObject();
    $fileName = $fo->getRelativePath();
    $thumbnail = $ih->getThumbnail($fo, intval($controller->thumbnailWidth), intval($controller->thumbnailHeight));
}


There only change is in this line:

<img src="<?php echo $ih->getThumbnail($fo, 200, 100)->src;?>" alt="<?php echo $controller->altText;?>"/>