[libcamera-devel] [PATCH] android: exif: Contain IMAGE_WIDTH and IMAGE_LENGTH data

Umang Jain umang.jain at ideasonboard.com
Tue Mar 23 10:04:37 CET 2021


Hi Hiro,

On 3/23/21 1:32 PM, Hirokazu Honda wrote:
> ChromeOS camera test checks if exif data has the IMAGE_WIDTH and
> IMAGE_LENGTH and they are the same as the requested jpeg size.
> This adds the resolution data to exif.
>
> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
>
> ---
>   src/android/jpeg/exif.cpp | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp
> index 922086cd..29c7be0f 100644
> --- a/src/android/jpeg/exif.cpp
> +++ b/src/android/jpeg/exif.cpp
> @@ -286,6 +286,8 @@ void Exif::setModel(const std::string &model)
>
>   void Exif::setSize(const Size &size)
>   {
> +	setLong(EXIF_IFD_0, EXIF_TAG_IMAGE_LENGTH, size.height);
> +	setLong(EXIF_IFD_0, EXIF_TAG_IMAGE_WIDTH, size.width);
I am reading the EXIF spec and for ImageLength and ImageWidth, it states:

```
ImageWidth
The number of columns of image data, equal to the number of pixels per 
row. In JPEG compressed
data, this tag shall not be used because a JPEG marker is used instead 
of it.
```

Same for ImageLength.

We compress the image using JPEG post-processor right? Hence, I think 
these tags shouldn't be applicable (as per spec's point of view).

>   	setLong(EXIF_IFD_EXIF, EXIF_TAG_PIXEL_Y_DIMENSION, size.height);
>   	setLong(EXIF_IFD_EXIF, EXIF_TAG_PIXEL_X_DIMENSION, size.width);
>   }
> --
> 2.31.0.rc2.261.g7f71774620-goog
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Umang Jain


More information about the libcamera-devel mailing list