Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » JPEG Images do not get rotated correctly
Re: JPEG Images do not get rotated correctly [message #50374 is a reply to message #50372] Thu, 04 October 2018 18:13 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1213
Registered: August 2007
Senior Contributor
Hello Tom,

Well, adding this to Raster is not so trivial, as -AFAIK- this EXIF orientation tag is currently jpeg specific and Raster::GetImage is not virtual.

I'd rather add this as a JPGRaster method.

Image JPGRaster::GetNormalizedImage()
{
	Value n = GetMetaData("orientation");
	Image img(GetImage());

	if(!IsNull(n))
		switch((int)n){
			case 2:
				img = MirrorHorz(img);
				break;
			case 3:
				img = Rotate180(img);
				break;
			case 4:
				img = MirrorVert(img);
				break;
			case 5:
				img = RotateAntiClockwise(MirrorHorz(img));
				break;
			case 6:
				img = RotateClockwise(img);
				break;
			case 7:
				img = RotateClockwise(MirrorHorz(img));
				break;
			case 8:
				img = RotateAntiClockwise(img);
				break;
			default:
				// Natural orientation
				break;
		}
	return pick(img);
}



Of course, it is up to Mirek and/or the developer(s) of the plugin to decide. Smile


Best regards,
Oblivion


[Updated on: Thu, 04 October 2018 19:00]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DrawArc not working in GTK mode
Next Topic: RescaleFilter.cpp: Implicit conversion from bool to double
Goto Forum:
  


Current Time: Wed Jun 25 10:07:41 CEST 2025

Total time taken to generate the page: 0.09261 seconds