• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Option or button to let User Rotate Images

thomasmes

Member
Now that the image element supports 'Device Capture: Camera' automatic rotation or an option to rotate image is welcome. Pictures that are taken in portrait view are saved as landscape. If users can rotate the image or thumb afterwards, this would solve the problem. I do see a GD2 class for image rotation: http://fabrikar.com/docs/classes/FabimageGD2.html but I do not know how to implement this. can this be done via a calc element or list plugin?
 
Any words on this? Can this be done with the calc element or with the php list plugin, so that the image (path) is ran through Image Magick, something like:

http://php.net/manual/en/imagick.rotateimage.php
<?php
header('content-type: image/jpeg');
$imagick = new Imagick();
$imagick->readImage('{table___image}');
$imagick->rotateImage(new ImagickPixel(), 90);
print $imagick->getImage();
?>
 
Oh, sorry thought I'd replied. I looked at this, and the only workable way I could think of doing it would be with a list plugin. Either quick and dirty with the PHP plugin, or "properly" by creating a purpose built, configurable plugin.

BTW, I've tried every which way to get a "Image - camera" upload from my phone to orient incorrectly, can't do it. How are you actually winding up with images in the wrong orientation? Is it phone specific?

-- hugh
 
I think there's exif information of phone position.
I'm using the cloudinary API, they have an option "angle"="exif", which will return the image in correct orientation.

But like Hugh I can't get "wrong" images from my phone with the fileupload.
 
Last edited:
I wonder what phones you are using? I have a Samsung Galaxy S4 and only picture taken in landscape come through correctly.
 
OK, I've had a hack at automating this if the EXIF data is set for orientation:

https://github.com/Fabrik/fabrik/commit/c73254d368d483f9088161cb6c294dd530de4c93

So during upload processing, we'll check to see if EXIF orientation data is present, and rotate the image accordingly. I can't test it "for real", as my uploads have EXIF orientation of 1, meaning they have already been processed for the correct orientation. But if I run it in debug, and manually change that orientation value to force it to rotate, it does so.

It's a WiP feature, so you'll have to enable WiP on the element to test it.

I'm not sure how useful this will be, as I suspect most phones that don't handle orientation properly probably don't set the EXIF data. But who knows.

Let me know.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top