Code Monkey home page Code Monkey logo

Comments (16)

emma-adams-machine avatar emma-adams-machine commented on May 25, 2024 1

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.

arpitalopa avatar arpitalopa commented on May 25, 2024

not fixed

from react-image-file-resizer.

eminx avatar eminx commented on May 25, 2024

I'm also having the same problem.

Why is the issue closed?

from react-image-file-resizer.

eminx avatar eminx commented on May 25, 2024

@onurzorluer ??

from react-image-file-resizer.

onurzorluer avatar onurzorluer commented on May 25, 2024

I think this problem caused by images EXIF Data. Did you try remove it? @eminx @arpitalopa

from react-image-file-resizer.

alexvirga avatar alexvirga commented on May 25, 2024

Having the same issue. Any work-arounds?

from react-image-file-resizer.

onurzorluer avatar onurzorluer commented on May 25, 2024

I think this problem caused by images EXIF Data. Did you try remove it? @eminx @arpitalopa

@alexvirga

from react-image-file-resizer.

arpitalopa avatar arpitalopa commented on May 25, 2024

@onurzorluer currently, i am not working on it

from react-image-file-resizer.

onurzorluer avatar onurzorluer commented on May 25, 2024

@arpitalopa any update?

from react-image-file-resizer.

oggktlmr avatar oggktlmr commented on May 25, 2024

is going to read the exif orientation and rotate the image automatically?

from react-image-file-resizer.

onurzorluer avatar onurzorluer commented on May 25, 2024

Yep, I think this is happening.

from react-image-file-resizer.

kocur4d avatar kocur4d commented on May 25, 2024

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.

emma-adams-machine avatar emma-adams-machine commented on May 25, 2024

@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.

kocur4d avatar kocur4d commented on May 25, 2024

OK, so mine problem was fixed by implementing this:

https://stackoverflow.com/questions/61334936/drawing-photo-from-file-to-canvas-rotates-in-chrome-based-on-exif

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.

eminx avatar eminx commented on May 25, 2024

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:

https://stackoverflow.com/questions/61334936/drawing-photo-from-file-to-canvas-rotates-in-chrome-based-on-exif

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.

onurzorluer avatar onurzorluer commented on May 25, 2024

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)

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.