exif

Using libexif in Python

拈花ヽ惹草 提交于 2019-12-25 18:42:37
问题 I'm writing a Python-based [web] application that needs to be able to read and write EXIF data. libexif seems to have all the right ingredients, but I can't work out how (or if) I could access it access it by using Python's ctypes library? I'm new to C, suppose I need see a .so for this to work? 回答1: You need to be running on an os that you can obtain the required library, to download the .h files, (usually the -dev package gives you these). Then you need to work your way through the ctypes

Rotate and save image for JavaScript

人走茶凉 提交于 2019-12-25 14:29:06
问题 I am writing a webapp which loads the image and display on canvas (more exact, I am writing a Tizen app which uses HTML5/JavaScript). I can load the image properly: function loadImage(file) { var img = new Image(); img.src = file; return img; } Everything works fine until I started to get images which display in wrong orientation. I figure out how to get the EXIF and orientation, and I was wondering how do I change the above function to return a proper image? function loadImage(file) { var

JPEG - Can EOI Marker appear inside image data after SOS?

为君一笑 提交于 2019-12-25 04:34:16
问题 I understand that a JPEG file starts with 0xFFD8 (SOI), followed by a number of 0xFFE n segments holding metadata, then a number of segments holding the compression relate data (DQT, DHT, etc) of which the final one is 0xFFDA (SOS); then comes the actual image data which ends with 0xFFD9 (EOI). Each of those segments states its length in the two bytes following the JPEG marker so it is a trivial execise to calculate the end of a segment/start of next segment and the start of the image data

常见图片格式详解

南楼画角 提交于 2019-12-25 02:58:20
做了几年有关图形、图像的工作,对图片格式算是小有经验,在此写成一文章总结下。虽然一开始并不想讲很理论的东西,但写完后发现几乎全是理论,细想一下关于图片格式的知识本身就是理论的东西,囧~~ 那就力求用最简单的方式将这些“理论”讲清楚吧。 常见的图片格式有bmp, jpg(jpeg), png, gif, webp等。 图像基本数据结构 要讲图片格式还先得从图像的基本数据结构说起。在计算机中, 图像是由一个个像素点组成,像素点就是颜色点,而颜色最简单的方式就是用RGB或RGBA表示, 如图所示 (图1) (图2) 如果有A通道就表明这个图像可以有透明效果。 R,G,B每个分量一般是用一个字节(8位)来表示,所以图(1)中每个像素大小就是3*8=24位图, 而图(2)中每个像素大小是4*8=32位。 这里有三点需要说明: 一、图像y方向正立或倒立 图像是二维数据,数据在内存中只能一维存储,二维转一维有不同的对应方式。比较常见的只有两种方式: 按像素“行排列”从上往下或者从下往上。 如图所示的图像有9个像素点,如果从上往下排列成一维数据是(123456789), 如果是从下往上排列则为(789456123)。 只所以会有这种区别是因为,前一种是以计算机图形学的屏幕坐标系为参考(右上为原点,y轴向下 ),而另后一种是以标准的数学坐标系为参考(右下为原点,y轴向上)。这两个坐标系只是y值不一样

ExifInterface returns null for all Tags

余生长醉 提交于 2019-12-25 02:25:10
问题 I have a problem with my class, when i call .getMake(); it always returns null, so I get the string "No Data". I know that Uri is not null because i get ther first Toast every time, with the uripath. I also know that the image has the tag "TAG_MAKE" (I checked it). It even didn't work with all the other tags. What should I change? public class ExifE { private Uri uri; private ExifInterface exifI; private Context context; public ExifE(Context con) { context = con; SharedPreferences prefs =

Is there anyway to configure twelve monkeys JPEGSegmentUtil segment reader to read all segments of a JPEG

时间秒杀一切 提交于 2019-12-25 01:55:43
问题 I am currently prototyping functionality in an app I wish to create, which requires the ability to read/modify/write metadata of a jpeg file. One way I thought might work for this is to use the twelve-monkeys java API to read all segments in, modify those metadata segments I am interested in, and write all the segments (most of them being unmodified) back to a new file. In my prototyping I came across a hurdle which triggered a question I, I have to admit, direct mainly at the author of the

How to fix exif warnings and problems in JPG files?

让人想犯罪 __ 提交于 2019-12-24 23:15:29
问题 I wrote my own camera app. This app writes exif information in the jpg files. It works well but I have some problems with the exifInferface class, e.g., I get the following errors when re-read the JPG file: Warning Invalid EXIF text encoding Warning Invalid size (8589934590) for IFD0 tag 0x8827 Warning Bad IFD1 directory I know that my IFD0 pointer at the exif-Information is broken. It may be that while writing the exif information the pointer is broken? However, I've Googled and found

Android camera2 compare image timestamp with CaptureResult SENSOR_TIMESTAMP

梦想的初衷 提交于 2019-12-24 12:22:49
问题 I am using camera2 api to capture images in a loop. When I capture a image, I get callback in onCaptureCompleted method and there I use TotalCaptureResult to get information about the image like iso, exposure and timestamp. Then I store these information in a map. After that I get the image in OnImageAvailableListener of ImageReader and I use image's getTimestamp method and ExifInterface to get exif data like iso and exposure. Surprisingly, the values of iso and exposure is different for the

php iphone/IOS6 upload rotation issue: what is best way to save rotated image

寵の児 提交于 2019-12-24 11:36:53
问题 Using the safari mobile browser with IOS6, the file upload function gives users the option to snap a photo. Unfortunately, upon snapping the photo, while the photo thumb shows up properly in the browser, when you upload to a server, the file is rotated 90 degrees. This appears to be due to the exif data that the iphone sets. I have code that fixes the orientation by rotating the image when serving. However, I suspect it would be better to save the rotated, properly oriented, image so I no

PHP EXIF data not working

老子叫甜甜 提交于 2019-12-24 01:22:14
问题 I am new to PHP, and adapting a script from http://www.techrepublic.com/article/create-a-dynamic-photo-gallery-with-php-in-three-steps/ which generates a table of images in a directory along with some accompanying EXIF data. The only problem is that the code has not display the EXIF data. This happens with even the original source code. My best guess of what is happening is that something in the original source code is old and outdated, and no longer supported by modern PHP. I have made sure