RSS/Atom feed Twitter
Site is read-only, email is disabled

Megapixels counter

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

Megapixels counter Bogdan Szczurek 28 Sep 02:02
  Megapixels counter Martin Nordholts 29 Sep 22:16
   Megapixels counter Bogdan Szczurek 29 Sep 23:32
    Megapixels counter Martin Nordholts 30 Sep 08:02
     Megapixels counter Sven Neumann 30 Sep 11:03
     Megapixels counter Bogdan Szczurek 30 Sep 11:20
Bogdan Szczurek
2010-09-28 02:02:57 UTC (over 14 years ago)

Megapixels counter

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

Martin Nordholts
2010-09-29 22:16:50 UTC (over 14 years ago)

Megapixels counter

On 09/28/2010 02:02 AM, Bogdan Szczurek wrote:

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.

Hi!

IMO we need to make it easier than editing a complex format-string to get this info in the window title.

But that's a different project...

Are you sure it is best to divide with 1000000 and not 1024*1024?

/ Martin

Bogdan Szczurek
2010-09-29 23:32:11 UTC (over 14 years ago)

Megapixels counter

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.

Hi!

IMO we need to make it easier than editing a complex format-string to get this info in the window title.

Well… I haven't thought of that, to be frank, since I'm comfy with the current state of things :). Also, I just wanted to fill the gap that was important for me.

But that's a different project...

Are you sure it is best to divide with 1000000 and not 1024*1024?

Yes, I'm sure. Megapixel is decimal unit so 10e6 is right.

As an afterthought I would change presentation from 2 to 1 decimal places. I don't think there's much use of having such precise measurement as 1/100 of MP.

Best regards! thebodzio

Martin Nordholts
2010-09-30 08:02:33 UTC (over 14 years ago)

Megapixels counter

On 09/29/2010 11:32 PM, Bogdan Szczurek wrote:

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.

Hi!

IMO we need to make it easier than editing a complex format-string to get this info in the window title.

Well… I haven't thought of that, to be frank, since I'm comfy with the current state of things :). Also, I just wanted to fill the gap that was important for me.

As an afterthought I would change presentation from 2 to 1 decimal places. I don't think there's much use of having such precise measurement as 1/100 of MP.

I can certainly see that showing size in megapixels can be useful for our target user base. We're even lucky enough to have the prefect char 'M' free for it. So I have pushed a cleaned up version of your patch (that only uses 1 decimal) to git master:

commit aa47dd22f0d8d498c80236303e0ac27210a4e675 Author: Bogdan Szczurek
Date: Thu Sep 30 07:57:44 2010 +0200

app: Support 'M' for 'megapixels' in image title format string

/ Martin

Sven Neumann
2010-09-30 11:03:55 UTC (over 14 years ago)

Megapixels counter

On Thu, 2010-09-30 at 08:11 +0200, Martin Nordholts wrote:

On 09/29/2010 11:32 PM, Bogdan Szczurek wrote:

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.

Hi!

IMO we need to make it easier than editing a complex format-string to get this info in the window title.

Well… I haven't thought of that, to be frank, since I'm comfy with the current state of things :). Also, I just wanted to fill the gap that was important for me.

As an afterthought I would change presentation from 2 to 1 decimal places. I don't think there's much use of having such precise measurement as 1/100 of MP.

I can certainly see that showing size in megapixels can be useful for our target user base. We're even lucky enough to have the prefect char 'M' free for it. So I have pushed a cleaned up version of your patch (that only uses 1 decimal) to git master:

You missed to add the documentation for this new option. But I have taken care of that now:

commit 2a67bfcb1013333d597782a080e7f4963638e122 Author: Sven Neumann
Date: Thu Sep 30 10:11:45 2010 +0200

app: document the new display title option

app/config/gimpconfig-dump.c | 1 + app/display/gimpdisplayshell-title.c | 5 ++--- docs/gimprc.5.in | 4 ++++ etc/gimprc | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-)

Sven

Bogdan Szczurek
2010-09-30 11:20:36 UTC (over 14 years ago)

Megapixels counter

I can certainly see that showing size in megapixels can be useful for our target user base. We're even lucky enough to have the prefect char 'M' free for it. So I have pushed a cleaned up version of your patch (that only uses 1 decimal) to git master:

That's great news! Thanks for accepting and modifying my patch!

Regards! thebodzio