Coder Social home page Coder Social logo

jquery-check-image-size's Introduction

jQuery Image Resolution Checker

Simple jQuery plugin to check Image Resolution upon input-file selection

This plugin will show an error if the selected image in an HTML Input is not in the intended resolutions.

Installation

Include the plugin file after initializing jQuery:

<script src="jquery.js"></script> 
<script src="jquery.checkImageSize.min.js"></script>

Basic Usage

Apply to all file-input :

$("input[type=file]").checkImageSize();

Apply to specific file-input with class check-image-size :

$("input[type=file].check-image-size").checkImageSize();

File-Input Configurations

Simple File-Input with default options :

<input type="file" class="check-image-size" >

File-Input with custom options :

<input type="file" class="check-image-size" data-min-width="800" data-min-height="600" data-max-width="8000" data-max-height="6000" >

Options

$("input[type=file]").checkImageSize({
    minWidth: 800,		// Numeric; Pixel value
    minHeight: 600,		// Numeric; Pixel value
    maxWidth: 8000,		// Numeric; Pixel value
    maxHeight: 6000,		// Numeric; Pixel value
    showError: true,		// Boolean; Whether to show error messages
    ignoreError: false		// Boolean; Whether to ignore error and let the image pass through
});

Made with Love by Jose Philip Raja โ€” Founder & Creative Director of CreaveLabs IT Solutions LLP http://josephilipraja.com, https://creavelabs.com

jquery-check-image-size's People

Contributors

josephilipraja 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.