Edits to image viewing page - disable "download full resolution" offer and limit image preview size

kuzzzma

Core license
Hi,
need help to figure out how to accomplish two things, search was unsuccessful..

1. Most important thing: I need to disable option to download full resolution picture - button appears over image EVEN IF "download button" was disabled in theme options, which makes this setting useless.

What i want removed:

Screenshot_12.jpg

What I want to have: full resolution images uploaded, download button enabled, but without this hovering offer.

2. Reduce space taken by preview image on image page view - I want image title and description visible, right now image takes up 100 of width & height of browser, I want limit it to 80% of height

What I want visible:
Screenshot_13.jpg
 

kuzzzma

Core license
while second question I probably will manage to resolve by myself by digging through source files, first one is by far more annoying and I'm not as good with php
 

JakeSully

Network license
V3 Beta tester
reason why you are getting that button isn't actuall a download. When you click it, then it only loads up full resolution image, since inside admin area you have limit set to show instead of full image resolution. You can solve this by finding the limit in admin panel and put limit higher.
 

kuzzzma

Core license
reason why you are getting that button isn't actuall a download. When you click it, then it only loads up full resolution image, since inside admin area you have limit set to show instead of full image resolution. You can solve this by finding the limit in admin panel and put limit higher.

That's strangely not the case it seems, or I don't get this settting.
My "Image load max. filesize" in setting is set to 2Mb
Inspection of image page shows that "medium image" is shown (for which 650px width is set in settings, usual size is under 1Mb) - and I like this, less bandwidth spent.
If "max filesize" is increased - image view shows original file - which I don't want displayed outright, I would prefer it to be accessable through download only.

I managed to hide button over image preview through setting div and span class for this download to display:none, but still interestedin solution to disable it entirely, as i hate leaving hidden text and I think I might loose functionality for playing gifs this way (have to test though)
 

JakeSully

Network license
V3 Beta tester
you gota change it to 10MB, since image itself is 5,4MB. So setting limit to 2MB for what it should show will then give this button on image since it isn't showing full size of image.
 

kuzzzma

Core license
you gota change it to 10MB, since image itself is 5,4MB. So setting limit to 2MB for what it should show will then give this button on image since it isn't showing full size of image.

Well that's the point of my struggle
I don't want to show full size image to visitors, but this offer appears even if Download button is disabled - and anyone gets full size easily.
 

Rodolfo

Α & Ω
Chevereto Staff
Administrator
1. Most important thing: I need to disable option to download full resolution picture - button appears over image EVEN IF "download button" was disabled in theme options, which makes this setting useless.
Dashboard > Settings > Theme

Set to "Image load max. filesize (MB)" to zero (so there's no autoloading at all).

1543260662209.png

Then, add this custom CSS (Dashboard > Settings > Theme):

Code:
#image-viewer-loader { display: none !important; }

2. Reduce space taken by preview image on image page view - I want image title and description visible, right now image takes up 100 of width & height of browser, I want limit it to 80% of height

That one needs editing on image.js.php (js). You need to alter the canvas.height property in that file. Something like this should work:

Code:
        var canvas = {
                height: window.innerHeight - (typeof top !== "undefined" ? top.clientHeight : 0),
                width: viewer.clientWidth
            };
        canvas.height *= 0.8;
 
Top