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 #50392 is a reply to message #50390] Sat, 13 October 2018 19:07 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Tom1 wrote on Fri, 12 October 2018 21:21
Hi,

Found it.
In Raster.h it should read:

enum FlipMode {
	FLIP_NONE                 = 1,
	FLIP_MIRROR_HORZ          = 2,
	FLIP_ROTATE_180           = 3,
	FLIP_MIRROR_VERT          = 4,
	FLIP_TRANSPOSE            = 5,
	FLIP_ROTATE_CLOCKWISE     = 6,
	FLIP_TRANSVERSE           = 7,
	FLIP_ROTATE_ANTICLOCKWISE = 8,
}


And in jpgupp.cpp:
Raster::Info JPGRaster::GetInfo()
{
	ASSERT(data);
	Raster::Info info;
	info.kind = IMAGE_OPAQUE;
	if(data->cinfo.output_components == 1) {
		info.bpp = 8;
		info.colors = 256;
	}
	else {
		info.bpp = 24;
		info.colors = 0;
	}
	info.dots = data->dot_size;
	info.hotspot = Null;
	Value v = GetMetaData("orientation");
	if(IsNumber(v))
		info.orientation = clamp((int)v, 1, 8);
	return info;
}


I.e. The Exif orientation value runs from 1 to 8 instead of 0 to 7.

Anyway, thanks for this new easier way of dealing with photos!

Best regards,

Tom


Ops. FlipMode constants are as I wanted them (I think it is a good idea that 0 is "do nothing"), but I have forgot to subtract 1 in jpg. Fix commited.
 
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: Mon May 06 03:44:57 CEST 2024

Total time taken to generate the page: 0.02524 seconds