Rotate image before uploading using blueimp upload

I use blueimp upload widget to upload images to my file server, which works great.

The only problem is that I want to rotate the image correctly before uploading it to the server, so when I contact it through the URL, it displays in the correct orientation.

Any idea what setting to use?

+7
jquery file-upload orientation blueimp
source share
2 answers

Perhaps you need another plugin, for example https://fengyuanchen.imtqy.com/cropper/

rotate the preview image, then crop the image

+4
source share

This is a backend solution. We do not allow the loading of tiff images, so I did not enable image type checking.

$uploadedFile->tempName is the file path eg: "/var/www/site/upload/images/someImage.jpg" if(exif_imagetype($uploadedFile->tempName) == 2)//2 IMAGETYPE_JPEG { $exif = exif_read_data($uploadedFile->tempName); if(!empty($exif['Orientation'])) { $image = imagecreatefromjpeg($uploadedFile->tempName); switch($exif['Orientation']) { case 8: $image = imagerotate($image,90,0); break; case 3: $image = imagerotate($image,180,0); break; case 6: $image = imagerotate($image,-90,0); break; } imagejpeg($image, $uploadedFile->tempName); } } 
+1
source share

All Articles