Problem:
When uploading image taken from iPhone, it is displayed on the website rotated 90 degrees counter-clockwise. I've done research and understand certain meta data contained in the image file is causing this. Is there a good library to determine if this meta data is in the file and rotate it properly?
My app is build with Laravel and I was looking at Intervention Image to see if maybe that can solve this.
Thanks!
UPDATE:
Still not working. I've checked the php modules and exif and mbstring are enabled on the server.
Here's my code in my laravel controller. The image saves to the directory I specify, but just doesn't orientate properly. Image taken on mobile still shows as rotated on desktop. Thanks!
if (Input::hasFile('profile-image'))
{
$extension = Input::file('profile-image')->getClientOriginalExtension();
$fileName = rand(11111,99999).'.'.$extension;
$image = Image::make(Input::file('profile-image'))->orientate()->save('images/profiles/'.$fileName);
Auth::user()->update([
'image_path' => $fileName,
]);
}
Yes, you'll want the orientate() function it provides.
http://image.intervention.io/api/orientate
Modern cameras add EXIF data to photos that includes the orientation (as well as details about flash, exposure, aperture, etc.). Intervention and other libraries (I've used jhead in the past for autorotation) can use this data.
Related
i'm developing an App where I can upload images/photos from my phone photo gallery (ios device) to firebase.
Since I want to upload the images/photos in original format (e.g. *.HEIC for pictures taken by an iPhone) I need a plugin which allows me to do that.
Following plugin's I've tried so far:
wechat_assets_picker: this one does what I want to have and returns me a temporary path which contains the the picked image in it's original format (e.g.: /anyPath/tmp/IMG_0024.HEIC). But since I don't really like the UI of wechat_assets_picker, I would like to have sth. else. Maybe more native looking
image_picker: returns a path where the picture is converterd to *.jpeg (e.g.: /anyPath/image_picker_randomNumber.jpg). This is not what I want!
images_picker: same as image_picker... converts the image to *.jpg
image_pickers: similar to wechat_assets_picker but it does what I want. But I don't like the UI either
likk_picker: same - not what I'm looking for
file_picker: same - returns *.jpg
I'm getting tired trying all the plugins.
Is there anyone who can support? Maybe any other way how to pick an image from my gallery in it's original format and quality?
Thanks!
Given the fact that other plugins usually compress HEICs when picking, I would suggest you consider the below solutions:
wechat_assets_picker allows you to build your widgets using delegations. By override build delegates, you can customize each part or the whole part of the interface.
wechat_assets_picker depends on the underlying plugin photo_manager which allows you to build your widgets from the bottom on your own.
Is there a way to edit/ modify the exif data of the photot that are part of iOS photo library / gallery on the iPhone. Whenever I try to do that, iOS tries to save it as a separate image file. However, I would like to modify the exif data, without creating another copy of the photo. I used libexif as mentioned in the links below, however libexif lets you read and modify the data, but I could not figure out a way to store in the same file.
Gallery APIs in IOS (ALAsset, PhotoKit) do not seem to provide direct access to underlying physical file. They only provide APIs using which the image content can be accessed/ updated or inserted. They do not seem to have apis to modify the exif data. Also, libexif seems to work on the raw filename path. Is there a way to get the raw filename using PhotoKit or ALAsset ?
Am I missing something? Any help or pointers will be deeply appreciated.
How to write or modify EXIF data for an existing image on the filesystem, without loading the image?
Save original image data with modified metadata (no re-encoding) on iOS
I'm using the imageresizer plugin from http://imageresizing.net/.
The website i'm working on (an asp.net mvc5 application) contains some static images located in the /content/images folder in the root of the website.
The second part of the images is coming from the database through an MVC-controller. The static images are being resized without any problems, but the images coming from the database aren't being resized using this very same plugin.
I've created a controller called 'ImagesController' and mapped the url like 'images/'.
So the url could be like this;
http://localhost:55062/images/47cff4e6-8932-48dc-8baf-f328e89f3f83
When I make a request to this url i'm seeing my image correctly (in it's original size ofcourse), so no problems so far. So I've decided to add a with and height, and for testing purposes I also want to allow upscaling. So i'm making a request to the following url;
http://localhost:55062/images/47cff4e6-8932-48dc-8baf-f328e89f3f83?width=100&height=100&scale=both
The original size of the image behind this url is 2000 x 1334 pixels. So resizing it down to 100 x 100 pixels doesn't seem a problem to me. However, i'm seeing the image in it's original size.
A random static image on the url below is being resized without any problem;
http://localhost:55062/images/47cff4e6-8932-48dc-8baf-f328e89f3f83
What could this possibly be? I've already tried adding an extension to the url with the guid and i've also added a handler to the web.config so that .jpg urls are being ran through the .net pipeline, but unfortunately this doesn't help either. I'm quite stuck on this issue for a few hours now, so hopefully somebody can help me out on this?
The imageresizing.net debugging info is shown here: http://notepad.cc/gaxafe38
Thanks to the suggestion from TiestonT I was able to solve the problem using the SqlReader plugin.
I have been told this is possible to do but cannot get this to work.
Basically I am trying to cache and image using forge.file.cacheURL()
Now I can get the file just fine and display it in the page by creating a new Image object but what I want to do is use this cached image to change the image in the topbar.
When ever I try to do it I get an error saying "file not found" and after reading the docs a little more it seems that trigger may have "src/" coded into the class because if I put just "image/logo.png" the logo.png will show up in the header because its part of the app package.
I guess the question is.. Is my assumption correct?
Thanks!
The native UI elements (topbar/tabbar) load images directly from your apps package, not through a URL in the same ways images are shown in the webview.
What this means is that currently you can only use images included in your app in the topbar/tabbar modules.
in case anyone is interested in this, the ability was added a while ago to the API so you can now use a cached image or filesaveURL feature of forge to change the header image dynamically.
Is it possible to remove watermark placed with imagemagick library in past?
Thanks ;)
Update
I mean, I need to remove my logo from images. Can't find in official documentation, how to remove watermark from image.
Yes, if you restore the original file directory from a backup. I'm presuming that you've rendered a single-layered file, where IM composited/overlayed the watermark on the image. There is no reliable and practical way to remove such a mark generally manually, let alone via batch process. Exceptions might include if the watermark always rendered over a flat color, etc.
The logo can be removed easily using ffmpeg, by using its delogo filter. All you need to supply is the co-ordinates and dimensions of the logo present on the video.
This works on videos very swiftly, you can convert your image to a video and apply this filter, or even compile group of images to a video and later break it into frames to obtain clean images. All of this can be easily done using ffmpeg only.
eg for the filter syntax: ffmpeg -i (your video url) -f "delogo=x=0:y=0:w=100:h=77:band=10" -r (output file url)
Find the complete documentation here.