-
Notifications
You must be signed in to change notification settings - Fork 91
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
Croppa not rotating images on crop #112
Comments
Can you post the image that's not rotating for you? |
I also have this issue, images are not being auto-rotated based on the EXIF data. Here is the output from ExifTool for a sample image that is not working for me:
|
Ok, I see the problem. The exif_read_data function needs to read from the filesystem. But in Croppa 4, with the switch to supporting Flysystem, I'm interacting with raw image data throughout. I don't necessarily have a path to a file, like if the file was on a remote filesystem. Maybe I can do something like this: http://stackoverflow.com/a/5465741/59160. Or I need to save the image locally, like to a /tmp directory, while doing the image manipulations. Which is what I'll need to do if I DO switch to Intervention ( #110 ), which has the same issue: |
@weotch Any news on this issue? I just got this issue and don't really know what to do with it :/ |
I don't see myself working on it myself right now, but I'd take a PR. Or, like you suggest, you could apply the EXIF rotations immediately on file upload independent of Croppa. |
Croppa uses the weotch fork of PHPThumb, which is no longer accepting pull requests for the 1.0 branch. I came up with a workaround, but for all I know I'm doing something horrible or there are scenarios I'm not aware of in which this wouldn't be good to do, so use this workaround with caution. First, change the Second, replace this line from the Old: $exif = @exif_read_data($this->parentInstance->getFilename()); New: if ($this->parentInstance->isDataStream) {
$stream = fopen('php://temp', 'r+');
fwrite($stream, $this->parentInstance->getFilename());
rewind($stream);
$exif = @exif_read_data($stream);
}
else {
$exif = @exif_read_data($this->parentInstance->getFilename());
} |
I experienced this same issue, and have prepared a pull request to resolve it by copying the remote file to a temporary disk if desired. See: #210 |
I cannot make croppa auto rotate images in my laravel application. I use Homestead -v 2.1.4 and when i run the exif_imagetype function i get a valid callback, so i think exif should be installed.
The text was updated successfully, but these errors were encountered: