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

script-fu: file-pbm-save gives ppm file

This discussion is connected to the gimp-user-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.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

script-fu: file-pbm-save gives ppm file Roland Winkler 09 Jan 01:36
  script-fu: file-pbm-save gives ppm file Roland Winkler 09 Jan 17:05
   script-fu: file-pbm-save gives ppm file Joao S. O. Bueno 12 Jan 11:47
    script-fu: file-pbm-save gives ppm file Roland Winkler 12 Jan 16:29
     script-fu: file-pbm-save gives ppm file Bob Long 13 Jan 02:36
Roland Winkler
2015-01-09 01:36:16 UTC (over 9 years ago)

script-fu: file-pbm-save gives ppm file

I just wrote my first script-fu for gimp which is supposed to save an image in pbm format. It works fine - except for that it saves the image in ppm format instead of pbm format. (The real format is obvious from the size of the resulting file, though the file extension is pbm). What is going on here? If I remove the last line of the script and run the Save command from the menu, I get a "proper" pbm file.

This is with gimp 2.6.12 under ubuntu 12.04.

(define (script-fu-pbm-save image) (let ((nameparts (strbreakup (car (gimp-image-get-filename image)) "."))) (unless (and (> (length nameparts) 1) (member (car (last nameparts)) '("pbm" "PBM")) ) (set! nameparts (append (butlast nameparts) '("pbm"))) ) (let ((filename (unbreakupstr nameparts ".")) (layer (car (gimp-image-flatten image))) ) (unless (= 2 (car (gimp-image-base-type image))) (gimp-image-convert-indexed image 0 3 FALSE FALSE TRUE "")) (file-pbm-save RUN-NONINTERACTIVE image layer filename filename 1))))

Roland Winkler
2015-01-09 17:05:03 UTC (over 9 years ago)

script-fu: file-pbm-save gives ppm file

I just wrote my first script-fu for gimp which is supposed to save an image in pbm format. It works fine - except for that it saves the image in ppm format instead of pbm format. (The real format is obvious from the size of the resulting file, though the file extension is pbm). What is going on here? If I remove the last line of the script and run the Save command from the menu, I get a "proper" pbm file.

Kind of related:

There are two functions file-pnm-save and file-ppm-save (plus file-save-pgm and file-save-pbm). What is the difference between file-pnm-save and file-ppm-save? What triggers whethers file-pnm-save saves an image in ppm, pgm, or pbm format?

Thanks,

Roland

Joao S. O. Bueno
2015-01-12 11:47:59 UTC (over 9 years ago)

script-fu: file-pbm-save gives ppm file

It is a bug in this version of GIMP that no longer exists in gimp 2.8.0 and later -

it was corrected in February - 2012 by Massimo Valentini, just prior to the 2.8 version release
in May.

Please take in mind that GIMP do _not_ maintain bug-fix releases of outdated stable versions -
the current mainline branch is 2.8.x - and if your OS does not support that, either upgrade, or refrain from trying serious work on it.

I am pretty shure that although GIMP 2.8 is not the official packages for your 2012 Ubunut, there are GIMP 2.8 builds for it available under alternate install methods.

Regards,

js -> wrote:

I just wrote my first script-fu for gimp which is supposed to save an image in pbm format. It works fine - except for that it saves the image in ppm format instead of pbm format. (The real format is obvious from the size of the resulting file, though the file extension is pbm). What is going on here? If I remove the last line of the script and run the Save command from the menu, I get a "proper" pbm file.

Kind of related:

There are two functions file-pnm-save and file-ppm-save (plus file-save-pgm and file-save-pbm). What is the difference between file-pnm-save and file-ppm-save? What triggers whethers file-pnm-save saves an image in ppm, pgm, or pbm format?

Thanks,

Roland _______________________________________________ gimp-user-list mailing list
List address: gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list

Roland Winkler
2015-01-12 16:29:05 UTC (over 9 years ago)

script-fu: file-pbm-save gives ppm file

Good to know, thank you. I have not yet tried to build gimp myself, but I feel confident I should be able to get this working. Certainly, I understand you do not want to provide bugfixes for previous versions of gimp.

Roland

On Mon Jan 12 2015 Joao S. O. Bueno wrote:

It is a bug in this version of GIMP that no longer exists in gimp 2.8.0 and later -

it was corrected in February - 2012 by Massimo Valentini, just prior to the 2.8 version release
in May.

Please take in mind that GIMP do _not_ maintain bug-fix releases of outdated stable versions -
the current mainline branch is 2.8.x - and if your OS does not support that, either upgrade, or refrain from trying serious work on it.

I am pretty shure that although GIMP 2.8 is not the official packages for your 2012 Ubunut, there are GIMP 2.8 builds for it available under alternate install methods.

Bob Long
2015-01-13 02:36:42 UTC (over 9 years ago)

script-fu: file-pbm-save gives ppm file

Roland Winkler wrote on 13/01/15 02:29:

Good to know, thank you. I have not yet tried to build gimp myself, but I feel confident I should be able to get this working. Certainly, I understand you do not want to provide bugfixes for previous versions of gimp.

Roland

You should not have to build (if you mean compiling, etc) it yourself. Look, for example, at:

https://launchpad.net/~otto-kesselgulasch

Bob Long

> 
> On Mon Jan 12 2015 Joao S. O. Bueno wrote:
>> It is a bug in this version of GIMP that no longer exists in gimp
>> 2.8.0 and later -
>>
>> it was corrected in February - 2012 by Massimo Valentini, just prior
>> to the 2.8 version release
>> in May.
>>
>> Please take in mind that GIMP do _not_ maintain bug-fix releases of
>> outdated stable versions -
>> the current mainline branch is 2.8.x - and if your OS does not support
>> that, either upgrade, or refrain from trying serious work on it.
>>
>> I am pretty shure that although GIMP 2.8 is not the official packages
>> for your 2012 Ubunut, there are GIMP 2.8 builds for it available under
>> alternate install methods.