PHP read_exif_data and Adjust Orientation

Based on Daniel’s code I wrote a function that simply rotates an image if necessary, without resampling. GD function image_fix_orientation(&$image, $filename) { $exif = exif_read_data($filename); if (!empty($exif[‘Orientation’])) { switch ($exif[‘Orientation’]) { case 3: $image = imagerotate($image, 180, 0); break; case 6: $image = imagerotate($image, 90, 0); break; case 8: $image = imagerotate($image, -90, 0); break; … Read more

Exif manipulation library for python [closed]

You might want to check out exif-py: Python library to extract EXIF data from tiff and jpeg files. Very easy to use – $ ./EXIF.py image.jpg or the Python Imaging Library (PIL): The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image … Read more

Accessing JPEG EXIF rotation data in JavaScript on the client side

If you only want the orientation tag and nothing else and don’t like to include another huge javascript library I wrote a little code that extracts the orientation tag as fast as possible (It uses DataView and readAsArrayBuffer which are available in IE10+, but you can write your own data reader for older browsers): function … Read more

In Python, how do I read the exif data for an image?

You can use the _getexif() protected method of a PIL Image. import PIL.Image img = PIL.Image.open(‘img.jpg’) exif_data = img._getexif() This should give you a dictionary indexed by EXIF numeric tags. If you want the dictionary indexed by the actual EXIF tag name strings, try something like: import PIL.ExifTags exif = { PIL.ExifTags.TAGS[k]: v for k, … Read more

JS Client-Side Exif Orientation: Rotate and Mirror JPEG Images

The github project JavaScript-Load-Image provides a complete solution to the EXIF orientation problem, correctly rotating/mirroring images for all 8 exif orientations. See the online demo of javascript exif orientation The image is drawn onto an HTML5 canvas. Its correct rendering is implemented in js/load-image-orientation.js through canvas operations. Hope this saves somebody else some time, and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)