I'm on IP 4.1.1.
I want to upload a photo (for photo or gallery widget for example).
I take a portrait photo (jpg) on my pc but when I upload it, it is in landscape format...
I try to use read_exif_data and imagerotate (like in this post : PHP read_exif_data and Adjust Orientation) but it doesn't work.
An idea? Thanks in advance and have a nice day :)
At first you are talking like an end user "upload photo ...". But then you say you are ysing read_exif_data function and other stuff which is a programming.
If we are talking about the end user interface. Most likely your photo is actually landscape, but has meta data about how the image has to be rotated before displaying it. In that case just rotate the image on your computer and reupload.
Related
I have a requirement I need to merge/mask an image to its cover image. please see below pics
Cover image- (png mask)
Customer Photo
Final Image
Is this possible in PHP GD? Finally it should generate a single image.
Thanks!
working on a upload image feature for my custom CMS.
I have completed the feature, but have an image when uploading images from mobile devices. Only tested on IOS so far but the issue is:
If the user selects to take a picture and does so in portrait, when the image is saved it is rotated -90 degrees.
It is however fine in landscape. After some research I have found that it uses the exif data from an image and looks at the rotation. Is there a way to ignore this information and keep the image as it was taken?
Using a class to upload images I found on GitHub called bulletproof:
https://github.com/samayo/bulletproof
The link to the actual class:
https://github.com/samayo/bulletproof/blob/master/src/bulletproof.php
And this is the upload part from that:
$moveUploadedFile = move_uploaded_file($fileToUpload["tmp_name"], $this->uploadDir . "/" . $newFileName);
Thanks, Craig.
This PHP class doesn't apply any image rotation. A search for imagerotate() fails.
So this is not PHP related and you might ensure that by testing the image upload from another, non-iOS client.
Then, you might want to find out, if iOS has a setting to send the native, unmodifed image or if you have to apply some "rotate"-correction on iOS-device side to get a correct rotation before sending.
In other words: i believe the image is transformed on IOS device side, before the image is send.
iOS PNG Image rotated 90 degrees
iOS4 landscape photos sideways in e-mail
I want from user to upload an image of any size for (jpg,png,gif) format. After uploading the image I want him to crop the image (client side) using jquery and save that cropped image (php) to application folder.
Please tell me the feasible solution to make this functionality working fine.
ImageMagick is used for croping images:
http://www.sitepoint.com/crop-and-resize-images-with-imagemagick/
For using ajax:
http://www.sanwebe.com/2012/05/ajax-image-upload-and-resize-with-jquery-and-php
Given that you already have the PHP code to crop, use one of this plugins to allow the user define how she wants to crop the image and provide the data you need:
Guillotine: Very lightweight plugin that allows to crop, zoom and rotate images with touch support and it's responsive (demo).
Jcrop: Allows free selection cropping (demo).
It is simple image crop using jquery and php using cropbox.js
Please watch the following video
Simple image crop
I'm looking for some jQuery plugin or smth similar.
For example, I need to crop a photo on website and to save the result on server.
I know that it is better to do it in Adobe Flash, but I really need to do in using JS.
Very few browsers support selecting an image with Javascript and manipulating it without first uploading it to a server. Instead, you'll need to:
Allow user to upload image to server
When upload is complete, resize the image (with PHP) to a manageable size for the browser for preview
Show the resized preview image in the browser in something like JCrop
After the user chooses the crop area, have them click "Save"
On Save, pass the coordinates of the cropped area to the server/PHP to have it crop the original image. You'll have to scale the coordinates for the preview to coordinates for the original image.
Save the new image to disk/S3/whatever with PHP
I managed to do this without ever using my server or having the image touch my server by using http://transloadit.com/. I use transloadit's Javascript upload form to upload to their server storage (S3) and use a template that saves the original and resizes for preview. Both the original and preview are stored in transloadit's temporary S3 account, not mine. I then use JCrop to show the user the preview. Once they select the crop area I then tell transloadit to crop the original photo but with my crop coordinates (scaled from the preview image to fit the original) using a template that also makes several thumbnail sizes. Transloadit then saves all the images to my S3 account and tells me the URL where it saved it.
Check out jCrop. It's perfect for this stuff.
You are looking for JCrop
Here are some demos.
Here is an example implementing in on PHP.
I am trying to build a system that allows a user to select an image from their own computer, and crop it using the jCrop tool from jQuery. My question is can I show the image the user has selected from their system without uploading it to a system, I dont really want to do two uploads, unless I can do the first upload silently? Any help would be great.
Thank you.
You don't have to upload twice. Just upload the image at first time
Use jCrop and send image Thumbnail's coordinates(x,y), width and height.
Resize Image according to them
AFAIK, not using JavaScript and HTML (4) at the moment.
Flash can do image processing before upload - SWFUpload for example can resize images before uploading (doesn't support cropping though), but I don't know an Open Source implementation of a Cropping tool in Flash.
It will probably also be possible using HTML 5.
However, I don't see how you would need two uploads to do this? Isn't it 1. Upload 2. Show with Cropper 3. send Crop info to PHP script that processes the uploaded file?