U++ framework
Do not panic. Ask here before giving up.

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 #50372 is a reply to message #50371] Thu, 04 October 2018 14:33 Go to previous messageGo to previous message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Hi Oblivion,

Based on your findings, here's what needs to be done:
...
	Image rimg(r->GetImage());
	
	JPGRaster *jpg = dynamic_cast<JPGRaster*>(~r);
	if(jpg) {
		switch((int)jpg->GetMetaData("orientation")){
			// 1 = natural orientation
			case 2:
				rimg=MirrorHorz(rimg);
				break;
			case 3:
				rimg=Rotate180(rimg);
				break;
			case 4:
				rimg=MirrorVert(rimg);
				break;
			case 5:
				rimg=RotateAntiClockwise(MirrorHorz(rimg));
				break;
			case 6:
				rimg=RotateClockwise(rimg);
				break;
			case 7:
				rimg=RotateClockwise(MirrorHorz(rimg));
				break;
			case 8:
				rimg=RotateAntiClockwise(rimg);
				break;
		}
	}
	img.SetImage(rimg);
...


But how to embed it in plugin/jpg in the correct place so that it just works quietly in the background?

Best regards,

Tom
 
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: Sat Jul 18 23:06:39 GMT+2 2026

Total time taken to generate the page: 0.00561 seconds