impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 175 forks source link

How to change the dimensions for auto-cropping? #688

Open santo74 opened 9 years ago

santo74 commented 9 years ago

How can I change the dimensions used for the auto-cropping of uploaded images ? Right now thumbnails for galleries are 295x164 but I want them to be larger. The same applies for images used in lightboxes. Changing the css obviously results in blury images.

Apparently the theme.json file contains some settings related to image dimensions and therefore I tried to change those settings, but they don't seem to have any effect.

    "widget": { /* Image cropping settings for widgets. Require theme reinstall to take affect. */
        "image": {
            "width": 1280,
            "height": 500
        },
        "gallery": {
            "width": 450,
            "height": 250
        }
    },

In the comments it mentions that I have to reinstall the theme for the changes to take effect, but this is a bit unclear to me. How am I supposed to reinstall the theme without losing any of my customizations ? There is no uninstall button, so the only option I can see is to delete the files by hand and then re-copy them, but I don't see how this would make any difference. Instead of re-copying the same files, I can also re-install the base theme (bootstrap free) from the market place and then somehow re-add my customizations, but the base theme still has the smaller cropping settings, so again I don't see how this would make any difference.

Also, is there an easy way to define additional dimensions to be created for uploaded images?

wannaco commented 9 years ago

for thumbnails that should be it if you are referring to the Image size then take a look at the Controller of each widget and override it in your theme Galllery widget for example https://github.com/impresspages/ImpressPages/blob/master/Ip/Internal/Content/Widget/Gallery/Controller.php lines 193 and 194 And continue reading through the next lines for transform small

Override Views etc can be found here https://www.impresspages.org/docs/view

maskas commented 9 years ago

After you change theme.json values, you have to ractivate the theme for changes to take affect. To do so, activate some other theme and then restore the first one.

santo74 commented 9 years ago

Thanks for the responses. I did switch between themes multiple times, but it didn't have any effect. Today however, the images suddenly all have the correct (newly defined) dimensions. I'm sure I did clear the caching multiple times before without any result.

So somehow I probably triggered something to activate it correctly, but I currently have no clue what it could be.

Maybe it's an idea to add an option in the backend to force the recropping of images ?