[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Fwd: Re: Review Request: Add thubnail support for Microsoft Windows
From:       Pali =?utf-8?q?Roh=C3=A1r?= <pali.rohar () gmail ! com>
Date:       2009-09-17 13:48:54
Message-ID: 200909171548.55281.pali.rohar () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]

[Attachment #4 (text/plain)]



-- 
Pali Rohár
pali.rohar@gmail.com


["forwarded message" (message/rfc822)]


[Attachment #7 (multipart/mixed)]


Ok,
I create new patch, which extract icon with max width (from param width). It doesn't \
extract bigger icon, if smaller then max width is available. If all icons will be \
bigger, it extract first. Is this patch ok?

-- 
Pali Rohár
pali.rohar@gmail.com

On Ut 15. September 2009 18:23:30 you wrote:
> Pali Rohár wrote:
> > A lot of windows executables has in smaller resolution smaller color
> > bit depth. So smaller size of the thumbnail will be without color.
> 
> So you feel it is better to display something that has been resampled in 
> a way that is not intended, than to display the image that the 
> application authors intended to be seen at a given size (and optimized 
> for that size)?
> 
> We don't do this with *our* icons. Why should we penalize Windows icons 
> by abusing them thusly?
> 
> 


["windowsthubnail2.patch" (text/x-patch)]

Index: icoutils.h
===================================================================
--- icoutils.h	(revision 1023372)
+++ icoutils.h	(working copy)
@@ -21,7 +21,7 @@
 namespace IcoUtils {
 
 	bool convertExeToIco(const QString &inputPath, const QString &outputPath);
-	bool convertIcoToPng(const QString &inputPath, const QString &outputPath);
+	bool convertIcoToPng(const QString &inputPath, const QString &outputPath, int \
maxWidth=512);  
 };
 
Index: windowsimagecreator.cpp
===================================================================
--- windowsimagecreator.cpp	(revision 1023372)
+++ windowsimagecreator.cpp	(working copy)
@@ -39,7 +39,7 @@
 	if ( ! pngTempFile.open() )
 		return false;
 
-	if ( ! IcoUtils::convertIcoToPng(path, pngTempFile.fileName()) )
+	if ( ! IcoUtils::convertIcoToPng(path, pngTempFile.fileName(), width) )
 		return false;
 
 	if ( ! img.load(pngTempFile.fileName()) )
Index: icoutils.cpp
===================================================================
--- icoutils.cpp	(revision 1023372)
+++ icoutils.cpp	(working copy)
@@ -75,7 +75,7 @@
 
 }
 
-bool IcoUtils::convertIcoToPng(const QString &inputPath, const QString &outputPath) \
{ +bool IcoUtils::convertIcoToPng(const QString &inputPath, const QString \
&outputPath, int maxWidth) {  
 	QProcess icotool;
 
@@ -95,7 +95,7 @@
 
 	foreach ( QString line, output ) {
 		if ( regExp.indexIn(line) != -1 ) {
-			if ( regExp.cap(3).toInt() > width || ( regExp.cap(3).toInt() == width && \
regExp.cap(5).toInt() > depth ) ) { +			if ( ( index == 0 || regExp.cap(3).toInt() <= \
maxWidth ) && ( regExp.cap(3).toInt() > width || ( regExp.cap(3).toInt() == width && \
regExp.cap(5).toInt() > depth ) ) ) {  index = regExp.cap(2).toInt();
 				width = regExp.cap(3).toInt();
 				depth = regExp.cap(5).toInt();
Index: windowsexecreator.cpp
===================================================================
--- windowsexecreator.cpp	(revision 1023372)
+++ windowsexecreator.cpp	(working copy)
@@ -42,7 +42,7 @@
 	if ( ! IcoUtils::convertExeToIco(path, icoTempFile.fileName()) )
 		return false;
 
-	if ( ! IcoUtils::convertIcoToPng(icoTempFile.fileName(), pngTempFile.fileName()) )
+	if ( ! IcoUtils::convertIcoToPng(icoTempFile.fileName(), pngTempFile.fileName(), \
width) )  return false;
 
 	if ( ! img.load(pngTempFile.fileName()) )


["signature.asc" (application/pgp-signature)]
["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic