[libcamera-devel,v2,3/4] android: jpeg: exif: Fix setGPSLocation longitude
diff mbox series

Message ID 20210309085235.106691-4-paul.elder@ideasonboard.com
State Accepted
Headers show
Series
  • android: jpeg: exif: Fix GPS altitude
Related show

Commit Message

Paul Elder March 9, 2021, 8:52 a.m. UTC
There was a copy-paste error that caused the latitude to be set twice and
the longitude never. Fix this.

This is part of the fix that allows the following CTS test to pass:
- android.hardware.cts.CameraTest#testJpegExif

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

---
No change in v2
---
 src/android/jpeg/exif.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jacopo Mondi March 9, 2021, 1:22 p.m. UTC | #1
Ouch :)
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j

On Tue, Mar 09, 2021 at 05:52:34PM +0900, Paul Elder wrote:
> There was a copy-paste error that caused the latitude to be set twice and
> the longitude never. Fix this.
>
> This is part of the fix that allows the following CTS test to pass:
> - android.hardware.cts.CameraTest#testJpegExif
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> ---
> No change in v2
> ---
>  src/android/jpeg/exif.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp
> index cf9e632a..628382a9 100644
> --- a/src/android/jpeg/exif.cpp
> +++ b/src/android/jpeg/exif.cpp
> @@ -395,7 +395,7 @@ void Exif::setGPSLocation(const double *coords)
>  	std::tie<int, int, int>(deg, min, sec) = degreesToDMS(coords[1]);
>  	setString(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_LONGITUDE_REF),
>  		  EXIF_FORMAT_ASCII, deg >= 0 ? "E" : "W");
> -	setGPSDMS(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_LATITUDE),
> +	setGPSDMS(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_LONGITUDE),
>  		  std::abs(deg), min, sec);
>
>  	setByte(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_ALTITUDE_REF),
> --
> 2.27.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp
index cf9e632a..628382a9 100644
--- a/src/android/jpeg/exif.cpp
+++ b/src/android/jpeg/exif.cpp
@@ -395,7 +395,7 @@  void Exif::setGPSLocation(const double *coords)
 	std::tie<int, int, int>(deg, min, sec) = degreesToDMS(coords[1]);
 	setString(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_LONGITUDE_REF),
 		  EXIF_FORMAT_ASCII, deg >= 0 ? "E" : "W");
-	setGPSDMS(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_LATITUDE),
+	setGPSDMS(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_LONGITUDE),
 		  std::abs(deg), min, sec);
 
 	setByte(EXIF_IFD_GPS, static_cast<ExifTag>(EXIF_TAG_GPS_ALTITUDE_REF),