Megapixels counter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

There's a small thing that I missed in GIMP for some time. That thing
is a megapixel counter to add to window title or status. It's quite
useful for considering if image can be used as a stock graphics,
since most stocks constrain acceptable image sizes by Mp value. If
somebody thinks the same as me that this is worth including here's a
micro-patch:

--- gimp/app/display/gimpdisplayshell-title.c.old	2010-09-27
01:37:29.040691516 +0200 +++
gimp/app/display/gimpdisplayshell-title.c	2010-09-27
01:35:02.591824852 +0200 @@ -322,6 +322,15 @@ }
               break;
 
+            case 'M': /* image size in megapixels */
+              {
+                i += print (title, title_len, i, "%.2f",
+                            (gfloat) (gimp_image_get_width (image)
+                                      * gimp_image_get_height (image))
+                                      / 1000000);
+              }
+              break;
+
             case 'l': /* number of layers */
               i += print (title, title_len, i, "%d",
                           gimp_image_get_n_layers (image));

thebodzio

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux