You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I could use the imageExifService it was easy but since it's private I don't figure out how to do this.
Can I do this without overriding it?
The text was updated successfully, but these errors were encountered:
dvirHam
changed the title
How to get image with max-width: X, or max-height: X while keeping the aspect ratio
How to get image with both max-width: X, or max-height: X while keeping the aspect ratio
Feb 7, 2018
dvirHam
changed the title
How to get image with both max-width: X, or max-height: X while keeping the aspect ratio
How to resize image with both max-width: X, or max-height: X while keeping the aspect ratio (and leaving the other larger)
Feb 7, 2018
From the documentation I think the following should work, haven't tried it myself yet:
Method to resize files if necessary down to a certain maximal width or maximal height in px. If you want only one limit just set the other max to 10.000: for example resize([myfile1,myfile2],2000,10000).subscribe([...]
Having said that, since this library already uses EXIF it would be great to expose the properties using a service.
I can open a separate issue if needed.
I, for example, need to get the geo location of the image if it exists and resize it before uploading. If I could get it in the same package it would be great.
I'm using the resizeImage function with Angular7 to resize a photo taken with a Smartphone.
I noticed that if we fix the width value but the orientation of the pictures produce a rotation then the values maxWidth/maxHeight must be inverted because of that rotation and currently this inversion is not taken into account.
I extracted the private function and inserted the following example logic:
letcurrentWidth=orientedImg.width;letcurrentHeight=orientedImg.height;// If Landscape, invert resize values to respect the EXIF orientationif(currentWidth>currentHeight){lettemp=maxWidth;maxWidth=maxHeight;maxHeight=temp;}
Now the image respect w/h sizes accordingly with the original EXIF orientantion!
If I could use the imageExifService it was easy but since it's private I don't figure out how to do this.
Can I do this without overriding it?
The text was updated successfully, but these errors were encountered: