Coder Social home page Coder Social logo

Comments (2)

awong234 avatar awong234 commented on May 24, 2024 1

I think I've solved it:

In nova-themes/novagallery/album.php, around line 36, modify the code so that the image link itself does not have pass a $size argument:

<a href="<?php echo Image::url($album, $element); ?>"> <!-- <------------ here remove the Site::config('imageSizeBig') argument -->
  <img src="<?php echo Image::url($album, $element, Site::config('imageSizeThumb')); ?>" loading="lazy" class="rounded"><br>
</a>

Do the same in the nova-themes/novagallery/home.php file.

Then, in nova-base/lib/image.php, modify the lines around 83-89:

$url = IMAGES_URL.'/'.$album.'/'; <!-- Changed so that it does not point to cache -->

if($size){
  $url = IMAGES_URL.'/'.$album.'/cache/'; <!-- Points to cache here -- it really only needs to do this for the thumbnails, or if the user actually wants to cache an imageSizeBig config  -->
  $url .= $size.'/';
}

I don't have a pull request out yet, because I think it can be handled better at the site config level. For instance, if imageSizeBig: 'original' is set (or something like that) , then the code can test against that and handle whether to add the 'cache' to the URL or not.

from novagallery.

keusendev avatar keusendev commented on May 24, 2024

Hi

I have the same issue. All the images are already in an optimized format. I very much like to see an option to disable this behaviour 👍.

BTW great and simple gallery ❤️. We also supported the project/product by buying the Pro version 😃.

from novagallery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.