GithubHelp home page GithubHelp logo

jzvikas / foc_image_flexible_size Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freeocart/foc_image_flexible_size

0.0 1.0 0.0 157 KB

Simple workaround to get more flexible image size control in Opencart

Home Page: https://freeocart.ru/en/project/foc-image-flexible-size/

Shell 100.00%

foc_image_flexible_size's Introduction

FOC:Image flexible size ocmod

Ocmod with backward compatibility for getting more control at image cropping. Can be used to get image with it’s original size.

Opencart support: version 2.3 and higher.

Default resize logic built on scaling image by it’s minimal side and putting the result into a fixed size container.

In most cases this behaviour expected and correct, but there are two limitations:

  1. It’s not possible to output images with their original size
  2. You cannot control which side must be used for scale
  3. This simple ocmod solve those problems.

Control is very simple:

  1. To disable resize and output image as is just add 0 (zero) as a prefix in your theme image size settings
  2. To force scale by width – prefix your height with zero
  3. To force scale by height – prefix your width

Example settings: Example settings

Result: Example result

Backward compatibility

You can safely enable/disable this ocmod, since Opencart translate these sizes in integers, so 0500 become 500 with disabled module.

foc_image_flexible_size's People

Contributors

ikenfin avatar

Watchers

 avatar

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.