Git Product home page Git Product logo

jquery-image-resize's People

Contributors

adeelejaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jquery-image-resize's Issues

IE7, resize does not apply to multiple element with same ID

Only the first image with the same ID is resized. In IE8 and FF3, any number of images that share the same ID are resized.

WORKS
$(function() {
$( ".resizeme" ).aeImageResize({ height: 250, width: 250 });
});
Resized Sample Image
Resized Sample Image
Resized Sample Image

DOES NOT WORK
$(function() {
$( "#resizeme" ).aeImageResize({ height: 250, width: 250 });
});
Resized Sample Image
Resized Sample Image
Resized Sample Image

resize issue

I like your plugin but i really needed the previous version that scales the image.

$('#thumbs img").resize(400);

This will configure the height that way the image isn't distorted. Can you add this option to the plugin?

Thanks,

Matt

Plugin doesn't work in IE9

Hi. After implementing it and watching it working in Firefox and Chrome, what was my surprise when i loaded my page (http://www.universoweb.com/jordiescandell/fotografia.php?idimagen=130) in IE9 and realised that the plugin doesn´t work in this browser. Then checked your jsfiddle version and it doesn´t work either (http://jsfiddle.net/CpFDm/). Checking the code in firebug and ie9 developer tool it seems that, in IE, the image doesn´t print the new height and width values "on the fly". Hope you can find a solution because the plugin works fine in firefox and chrome. Thanks in advance.

return width and height

It would be nice if the plugin would return an object with the new width and height values set to the image, so if you want to use the updated size of the image you don't have to query it again.

[enhancement] Add missing bower.json.

Hey, maintainer(s) of adeelejaz/jquery-image-resize!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library adeelejaz/jquery-image-resize is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "adeelejaz/jquery-image-resize",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Doesnt work in all major A-browsers.

works in chrome 6beta. And in Firefox 3.6.8 but it's buggy - at the first pageload the images arent resized. Doesnt work at all in IE8 + IE8 Compatibility mode. Havent tested other browsers. Just thought id let u know. :)

jQuery 1.9.1 Compatibility issue

I think you already noticed what from jQuery 1.9 they have the $.browser variable removed. ae will throw error and so not useable since that version.

no method 'aeImageResize'

Hi,

Hope you are still around.

Have an issue and get that error messgae:

"Uncaught TypeError: Object [object Object] has no method 'aeImageResize' "
I'm working on wordpress, paid attention to js files call order, just copy-pasted the function call from your doc : "$('.resizeme').aeImageResize", and added the resizeme class to my but still have this error. Any requirement I could have forget ?

I am dynamicly giving the src to my from an other dom elemnt if it can helps.

Thaks for any help

IE9 Resize Issue (Slightly more elegant fix)

Even using the latest version, the resize wasn't working for me in IE9. The fix is simple and means you can remove the "this.src = this.src" workaround:

;
(function($) {
  $.fn.aeImageResize = function(params) {
    var aspectRatio = 0;

    // We cannot do much unless we have one of these
    if (!params.height && !params.width) {
      return this;
    }

    // Calculate aspect ratio now, if possible
    if (params.height && params.width) {
      aspectRatio = params.width / params.height;
    }

    // Attach handler to load
    // Handler is executed just once per element
    // Load event required for Webkit browsers
    return this.one("load", function() {

      // Remove all attributes and CSS rules
      this.removeAttribute("height");
      this.removeAttribute("width");
      this.style.height = this.style.width = "";

      var imgHeight = this.height, imgWidth = this.width, imgAspectRatio = imgWidth / imgHeight, bxHeight = params.height, bxWidth = params.width, bxAspectRatio = aspectRatio;

      // Work the magic!
      // If one parameter is missing, we just force calculate it
      if (!bxAspectRatio) {
        if (bxHeight) {
          bxAspectRatio = imgAspectRatio + 1;
        } else {
          bxAspectRatio = imgAspectRatio - 1;
        }
      }

      // Only resize the images that need resizing
      if ((bxHeight && imgHeight > bxHeight) || (bxWidth && imgWidth > bxWidth)) {

        if (imgAspectRatio > bxAspectRatio) {
          bxHeight = ~~(imgHeight / imgWidth * bxWidth);
        } else {
          bxWidth = ~~(imgWidth / imgHeight * bxHeight);
        }

        $(this).height(bxHeight).width(bxWidth);
        //this.height = bxHeight;
        //this.width = bxWidth;
      }
    })
      .each(function() {

        // Trigger load event (for Gecko and MSIE)
        if (this.complete) {
          $(this).trigger("load");
        }

        // This fixes IE9 issue
        //this.src = this.src;
      });
  };
})(jQuery);

Image resizes inconsistently with other plugins

Sorry if this has been reported before.

I have noticed that when I use the plugin with some other Jquery plugins the image does not display at all or is not resized. If the browser is then refreshed the image will display correctly and is resized corretly.

I have two sites that I am using the plugin with and with both of them the image resizing is inconsistent.

At www.thescarletbow.com.au the About page displays an image of the author. On first page load the image does not display. Refresh the browser and the image is then displayed.

At www.stillframe.com.au/index.php (index.php must be in the URL) the About page displays an imge of the author. On first page load the image is not resized but the overflow is hidden as Ive placed the image inside a constrained div with overflow hidden. On refresh the image displays resized.

Any thoughts?

Image Resize down not up

Although this is minor, it's important to specify in the documentation that v2.1.1 does not size up, it only sizes image down.
Small images wont be sized up to the expected size.

Although this is generally the desired effect, it would be nice to have a simple option to 'force' a resize of the specified height/width

IE BUG

in IE shows alert "Stack overflow at line: 0"

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.