Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get actual image size #3

Open
drianautz opened this issue Nov 15, 2015 · 1 comment
Open

Get actual image size #3

drianautz opened this issue Nov 15, 2015 · 1 comment

Comments

@drianautz
Copy link

Hello, actually how to get the actuall image size as currently is always set the image to 256 x 256 on w x h, event i change the code to >

var file = files[0];
var width = $("#profile-avatar").width();
var height = $("#profile-avatar").height();

resizeImage: function(file, width, height, callback) {

  var fileTracker = new FileReader;
  fileTracker.onload = function() {
    Resample(
      this.result,
      width,
      height,
      callback
    );
  }
  fileTracker.readAsDataURL(file);

  var minValue = Math.min(img.height, img.width);
  var _width = $("#profile-avatar").width();
  var _height = $("#profile-avatar").height();
  width == null && (width = _width );
  height == null && (height =  _height);
  console.log(_width);
  console.log(_height);

its always show me the 256

Thanks

@graygilmore
Copy link

The size is being sent through here:

Avatar.resizeImage(file, 256, function(data) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants