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

imageDimensions(file) and $ngfWidth/$ngfHeight have wrong values #1490

Closed
thegitfather opened this issue Apr 20, 2016 · 4 comments
Closed

imageDimensions(file) and $ngfWidth/$ngfHeight have wrong values #1490

thegitfather opened this issue Apr 20, 2016 · 4 comments

Comments

@thegitfather
Copy link

The values vary depending on the actual browser window size. E.g. when I add an image with an actual width of 2000px and my Browser window is 1280px then the width value will show something like <1280px.

@danialfarid
Copy link
Owner

What device and browser?

@thegitfather
Copy link
Author

Happens in Chrome stable and Firefox. But I see the Demo is working (sorry - didn't think about checking it there first). Guess my problem is somewhere here

$scope.$watchCollection('vm.files', function(newVal, oldVal) {
      // console.log("newVal:", newVal);
      vm.busy = true;
      var fileErrors = 0;
      for (var i = 0; i < newVal.length; i++) {
        if (newVal[i].dimensions === undefined) {
          // TODO: https://github.com/danialfarid/ng-file-upload/issues/1490
          appendDimensions(newVal[i]);
        }
        if (newVal[i].$error !== undefined) {
          fileErrors += 1;
        }
      }
      $scope.queueInvalidLength = fileErrors;
      ...

I read something about adding ngf-min-width="0" so the dimensions get appended automatically. But I remember that I had the same problem then.. Not quite sure whats wrong but I will have a look into that later (but any hints are welcome of course :) )

thegitfather pushed a commit to thegitfather/photonline that referenced this issue Apr 28, 2016
thegitfather pushed a commit to thegitfather/ng-file-upload that referenced this issue May 3, 2016
jqLite .css() function has problems with `!important`. See e.g.:
angular/angular.js#5379
@thegitfather
Copy link
Author

Just created a new pull request (#1506). Should be safe to merge this I think.

@thegitfather
Copy link
Author

If somebody runs into this issue, simple fix would be:

body > img {
  max-width: none !important;
}

thegitfather pushed a commit to thegitfather/photonline that referenced this issue May 3, 2016
thegitfather pushed a commit to thegitfather/photonline that referenced this issue May 5, 2016
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