Re: extragear/graphics/gwenview

Aurelien Gateau <[email protected]>
Newsgroups gmane.comp.kde.gwenview
Message-ID <[email protected]>
On Sun, 25 Mar 2007 21:14:58 +0000, Angelo Naselli <[email protected]> wrote:
> SVN commit 646489 by anaselli:
> 
> Now jpeg with exif info can be managed for printing without scaling as
> well.
> Please Aurélien take a look at it.

Sounds great, thanks!

Only a few nitpicks:
- JPEGContent follows Qt naming convention of not prefixing getters with "get"
- The code in the two getters is almost identical. It could probably be merged like this:

dotsPerMeterX() {
  return dotsPerMeter("XResolution");
}

dotsPerMeterY() {
  return dotsPerMeter("YResolution");
}

dotsPerMeter(const QString& keyName) {
	Exiv2::ExifKey keyResUnit("Exif.Image.ResolutionUnit");
	Exiv2::ExifData::iterator it = d->mExifData.findKey(keyResUnit);
	if (it == d->mExifData.end()) {
		return 0;
	}
	int XRes = it->toLong();
	Exiv2::ExifKey keyXResolution("Exif.Image." + keyName");
	it = d->mExifData.findKey(keyXResolution);
	if (it == d->mExifData.end()) {
		return 0;
	}
	// The unit for measuring XResolution and YResolution. The same unit is used for both XResolution and YResolution.
	//     If the image resolution in unknown, 2 (inches) is designated.
	//         Default = 2
	//         2 = inches
	//         3 = centimeters
	//         Other = reserved
	const float INCHESPERMETER = (100. / 2.54); 
	switch (XRes) {
	case 3:  // dots per cm 
		return (it->toLong() * 100); 
	default:  // dots per inch 
		return (it->toLong() * INCHESPERMETER); 
	}

	return 0;
}

What do you think about this?

Aurélien



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Gwenview-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwenview-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.