Comments (16)
I have the same issue :(
Maybe the description can help you.
It just happened on the iPhone with the front camera. I put rotation property 0 but it is not working in this case.
from react-image-file-resizer.
not fixed
from react-image-file-resizer.
I'm also having the same problem.
Why is the issue closed?
from react-image-file-resizer.
@onurzorluer ??
from react-image-file-resizer.
I think this problem caused by images EXIF Data. Did you try remove it? @eminx @arpitalopa
from react-image-file-resizer.
Having the same issue. Any work-arounds?
from react-image-file-resizer.
I think this problem caused by images EXIF Data. Did you try remove it? @eminx @arpitalopa
from react-image-file-resizer.
@onurzorluer currently, i am not working on it
from react-image-file-resizer.
@arpitalopa any update?
from react-image-file-resizer.
is going to read the exif orientation and rotate the image automatically?
from react-image-file-resizer.
Yep, I think this is happening.
from react-image-file-resizer.
EDIT:
I did a bit more testing and it appears that the problem is browser related. Different browser, Chrome and Samsung one, does things differently. So just to describe what I am doing:
I receive images via phone camera. Usually those can be rotated with EXIF for a rotation to be set accordingly to 0,90, 180, 270... I want to have all of my pictures with rotation 0. So I check EXIF of the image and got a value 0,90, 180 or 270 returned. Then I pass the image with the rotation, found in a previous step, too the imageFileResizer
. Problem is that Samsung browser does what I need but Chrome is rotating the image overshooting the rotation. When I implement tthe fix to alway pass rotation 0 together with the image Chrome is working but Samsung is broken.
What I have observed is that couple of weeks ago the behaviour changed.
What I believe was happening in the past is that the EXIF rotation data was ignored and I was extracting it in a separate function and then passed the result to the imageFileResizer
as a rotation
so mine images got zero orientation as expected.
But now it stoped working. The images that have any rotation get extra rotation applied to it. So what I think is happening is this: The EXIF is no longer ignored and the image is automatically zeroed and then the rotation I am passing to the imageFileResizer
is applied resulting in the rotated image.
What is not helping that readme has two conflicting statements about rotation:
- in Usage: rotation, // is the rotatoion of the new image -> this imply that whatever I put here would end up being a rotation of the resized image so in my case I would always wanted to keep it as 0.
- in the Table below the example: rotation - Degree of clockwise rotation to apply to the image. Rotation is limited to multiples of 90 degrees.(if no rotation is needed, just set it to 0) (0, 90, 180, 270, 360) -> this imply that by whatever I put here mine image will be rotated so I need to check what is current orientation and adjust it so it will end up being 0.
So there is a possibility that something have changed in a behaviour outside of the scope of react-image-file-resizer
but I am not sure where.
Hope it makes sense.
from react-image-file-resizer.
@kocur4d
As I was said I checked it on a lot of phones such as iPhone, Xiaomi, Samsung, ... but just on the iPhone, this happened.
I set rotation prop 0 but it rotates 180degree.
from react-image-file-resizer.
OK, so mine problem was fixed by implementing this:
In the end it was browser related and support for image-orientation
. I am not sure how related it is to other people issues in this thread.
from react-image-file-resizer.
I'm not totally sure, but I have a very strong feeling that this is due to the phone camera orientation thing. Often when we have taken a photo, perhaps it's saved as portrait whereas user thinks it's landscape. So it may have nothing to do with this module.
A rotator may be necessary... Not sure.
OK, so mine problem was fixed by implementing this:
In the end it was browser related and support for
image-orientation
. I am not sure how related it is to other people issues in this thread.
I think what you say is in line with my opinion. Perhaps a PR on that regard??
from react-image-file-resizer.
I have developed a new module for exif orientation resetting. I think it will fix your problem.
Try & give a feedback please:
https://github.com/onurzorluer/exif-auto-rotate
@arpitalopa @alexvirga @eminx @oggktlmr @emma-adams-machine @kocur4d
from react-image-file-resizer.
Related Issues (20)
- Force resize HOT 1
- why is the rotation is not "set"
- No response (success nor error) with HEIC format. HOT 9
- imageFileResizer is not a function after build HOT 11
- We need a fixed aspact ratio attribute.
- Why a class?
- FileReader': parameter 1 is not of type 'Blob'. HOT 7
- react version 17.0.2 HOT 1
- Indeterminate result HOT 3
- imageFileResizer not a function after building with Vite HOT 14
- Support for GIF and Animated WebP HOT 2
- Is there anything underway to port this to Vuejs3 (or does it exist elsewhere)? HOT 1
- Image is getting pixeled after resizing it HOT 1
- Quality not affecting PNG format HOT 1
- add support for array or similar for outputType
- keep metadata
- Can't find variable: FileReader
- Resize algorithm
- File extensions concatenated
- Exact sizing not respected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-image-file-resizer.