Edited .pnm files don't display [Solved]

Using applications, configuring, problems
Post Reply
Message
Author
HerrBert
Posts: 152
Joined: Thu 03 Nov 2016, 15:11
Location: NRW, Germany

Edited .pnm files don't display [Solved]

#1 Post by HerrBert »

(Not sure if this is the right place to post, so please feel free to move this post to the right place...)

I've updated mtpaint on my Slackos to 3.44.73 due to translation issues with the delivered versions... But i guess, it's not about that.

What i'm asking about is:
I have scanned some photos to .pnm files. I can click them, and they will show up in (my defaultimageviewer) viewnior. Even thumbnails in rox can show a preview of the scanned images.

But:

When i edit a scanned .pnm-file in mtpaint and save it, neither viewnior nor gpicview or rox's thumbnail are able to display this file.
I can still open/edit the new file with mtpaint, but saving to suggested .ppm-format seems to destroy the ability to open the file in common viewers.

Do you have any suggestions how to keep the ability to display edited .pnm files?

TIA
[edited on Fr. Jan. 17 2020]
----------------

I will post the solution here, not to confuse users by reading the whole thread.

----------------

@wjaguar
I hope you accept my apology for having suspected mtpaint.

It's not an issue with mtpaint.

Previews/thumbnails work in XnView, TheGimp and even IrfanViewPortable (at least .ppm; IrfanView has no association to .pnm) on Slacko 6.3.2 (not tested on Slacko 5.7.0, but i guess it'll work there too)
  • On Slacko 700-rc3, rox shows a broken thumbnail for .ppm, but i can access it with gpicview.
    On Tahr 6.0.2, rox shows no thumbnail for .ppm, but i can access it with viewnior.
    On Porteus V4 Mate, Eye of Mate opens .ppm and .pnm, but Filemanager (caja) shows no thumbnail.
    On Porteus V4 Xfce, Thunar shows thumbnails and opens both filetypes in gpicview.
wjaguar wrote:Because when such an incompatibility suddenly gets observed, it needs be unraveled to its root cause. All kinds of weird breakage in external libraries had happened over the years, some needed workarounds, some others, warnings against specific versions.
I think it was more of a coincidence i stumbled upon. Since (my preferred) Slacko 5.7.0 and Slacko 6.3.2 are out of date anyway, i think we can leave this thread as a notification here...

Gathered some more information if of interest:

The reason, why i suspected mtpaint was the different filesize, when saving .pnm to .ppm (-334 bytes).
Later i found that this is caused by different fileheaders:
  • PNM File is of type image/x-portable-anymap
    19 M (19575135 bytes)
    Netpbm image data, size = 00 x 1, rawbits, pixmap
    Header:
    P6
    # XSane settings:
    # resolution_x = 600.0
    # resolution_y = 600.0
    # gamma IRGB = 1.00 1.00 1.00 1.00
    # brightness IRGB = 0.0 0.0 0.0 0.0
    # contrast IRGB = 0.0 0.0 0.0 0.0
    # color-management= 0
    # cms-function = 0
    # cms-intent = 0
    # cms-bpc = 0
    # icm-profile =
    # XSANE data follows
    03072 02124
    255
  • PPM File is of type image/x-portable-pixmap
    19 M (19574801 bytes)
    Netpbm image data, size = 3072 x 2124, rawbits, pixmap
    Header:
    P6
    3072 2124
    255
gdk-pixbuf2 versions are (taken from ~/.packages/woof-installed-packages):
Slacko 5.7.0:
  • gdk-pixbuf2-2.26.1|gdk-pixbuf2|2.26.1|2|BuildingBlock|3820K|slackware/l|gdk-pixbuf2-2.26.1-i486-2.txz|+glib2,+libX11,+libXau,+libXdmcp,+libjpeg,+libpng,+libtiff,+libxcb,+zlib|image library used by GTK+ v2|slackware|14.0||

    Deps:

    glib2-2.32.4-patched-s-i486|glib2|2.32.4-patched-s-i486||BuildingBlock|4128K||glib2-2.32.4-patched-s-i486.pet||glib|slackware|14.0||
    libX11-1.6.6|libX11|1.6.6|1_slack14.0||||libX11-1.6.6-i486-1_slack14.0.txz|||
    libXau-1.0.7|libXau|1.0.7|1|BuildingBlock|90K|slackware/x|libXau-1.0.7-i486-1.txz||Sample Authorization Protocol for X|slackware|14.0||
    libXdmcp-1.1.1|libXdmcp|1.1.1|1|BuildingBlock|300K|slackware/x|libXdmcp-1.1.1-i486-1.txz||X Display Manager Control Protocol library|slackware|14.0||
    libjpeg-v8a|libjpeg|v8a|2_slack14.0|BuildingBlock|710K|patches/packages|libjpeg-v8a-i486-2_slack14.0.txz||Independent JPEG Groups JPEG software|slackware|14.0||
    libpng-1.4.20|libpng|1.4.20|1_slack14.0||||libpng-1.4.20-i486-1_slack14.0.txz|||
    libtiff-3.9.7|libtiff|3.9.7|1_slack14.0|BuildingBlock|1660K|patches/packages|libtiff-3.9.7-i486-1_slack14.0.txz||a library for reading and writing TIFF files|slackware|14.0||
    libxcb-1.11.1|libxcb|1.11.1|2_slack14.0||||libxcb-1.11.1-i486-2_slack14.0.txz|||
    libxcb-1.8.1|libxcb|1.8.1|1|BuildingBlock|3690K|slackware/x|libxcb-1.8.1-i486-1.txz|+libXau,+libXdmcp|X protocol C language Binding|slackware|14.0||
    zlib-1.2.6|zlib|1.2.6|1|BuildingBlock|380K|slackware/l|zlib-1.2.6-i486-1.txz||compression library|slackware|14.0||

    netpbm-10.34-w5|netpbm|10.34-w5||BuildingBlock|684K||netpbm-10.34-w5.pet|+libxml|Collection of primitive graphics tools converters etc|puppy|wary5||
    netpbm_DEV-10.34-w5|netpbm_DEV|10.34-w5||BuildingBlock|340K||netpbm_DEV-10.34-w5.pet|+netpbm|Collection of primitive graphics tools converters etc|puppy|wary5||
Slacko 6.3.2:
  • gdk-pixbuf2-2.28.2|gdk-pixbuf2|2.28.2|2_slack14.1|BuildingBlock|4050K|patches/packages|gdk-pixbuf2-2.28.2-i486-2_slack14.1.txz||image library used by GTK+ v2|slackware|14.1||

    Deps not provided by woof-installed-packages in Slacko 6.3.2, so i 'greped' the same basenames from Slacko 5.7.0:

    glib2-2.36.4|glib2|2.36.4|1|BuildingBlock|32910K|slackware/l|glib2-2.36.4-i486-1.txz|+gamin,+libelf,+libffi,+zlib|library of C routines|slackware|14.1||
    libX11-1.6.6|libX11|1.6.6|1_slack14.1||||libX11-1.6.6-i486-1_slack14.1.txz|||
    libXau-1.0.8|libXau|1.0.8|1|BuildingBlock|100K|slackware/x|libXau-1.0.8-i486-1.txz||Sample Authorization Protocol for X|slackware|14.1||
    libXdmcp-1.1.1|libXdmcp|1.1.1|1|BuildingBlock|300K|slackware/x|libXdmcp-1.1.1-i486-1.txz||X Display Manager Control Protocol library|slackware|14.1||
    libjpeg-v8a|libjpeg|v8a|2_slack14.1|BuildingBlock|700K|patches/packages|libjpeg-v8a-i486-2_slack14.1.txz||Independent JPEG Group's JPEG software|slackware|14.1||
    libpng-1.4.20|libpng|1.4.20|1_slack14.1||||libpng-1.4.20-i486-1_slack14.1.txz|||
    libxcb-1.11.1|libxcb|1.11.1|2_slack14.1||||libxcb-1.11.1-i486-2_slack14.1.txz|||
    zlib-1.2.8|zlib|1.2.8|1|BuildingBlock|380K|slackware/l|zlib-1.2.8-i486-1.txz||compression library|slackware|14.1||

    netpbm-10.35.97-i686|netpbm|10.35.97-i686||BuildingBlock|5128||netpbm-10.35.97-i686.pet|+libjpeg,+libpng|a comprehensive suite of image manipulaton tools|slackware|14.1||
    netpbm_DEV-10.35.97-i686|netpbm_DEV|10.35.97-i686||BuildingBlock|128||netpbm_DEV-10.35.97-i686.pet|+netpbm|netpbm development||||
(Both Slackos updated with Slackware-Updates)

Sorry for the trouble and confusion that i may have caused.
Last edited by HerrBert on Fri 17 Jan 2020, 17:08, edited 2 times in total.
User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#2 Post by tallboy »

ImageMagick
Absolutely magic!
True freedom is a live Puppy on a multisession CD/DVD.
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#3 Post by don570 »

You should post on http://murga-linux.com/puppy/viewtopic.php?t=81136
wjaguar might help.
_________________________
wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

Re: mtpaint and .pnm files issue

#4 Post by wjaguar »

HerrBert wrote:I've updated mtpaint on my Slackos to 3.44.73 due to translation issues with the delivered versions...
The "issues" being what exactly?
When i edit a scanned .pnm-file in mtpaint and save it, neither viewnior nor gpicview or rox's thumbnail are able to display this file.
I can still open/edit the new file with mtpaint, but saving to suggested .ppm-format seems to destroy the ability to open the file in common viewers.
Given that in my full Slackware install, I find none of the three things you listed, I would refrain from calling any of them a "common" anything. ;)
Anyhow, I could not reproduce anything like the problem you describe; neither GQview nor GIMP nor ImageMagick nor Okular have the slightest problem with a PNM produced by scanning (XSane) and then modified and saved in mtPaint.
Do you have any suggestions how to keep the ability to display edited .pnm files?
The suggestion is, provide an example of the PNM file that your viewers cannot display. Things of this sort cannot be sorted out in the abstract.
HerrBert
Posts: 152
Joined: Thu 03 Nov 2016, 15:11
Location: NRW, Germany

Re: mtpaint and .pnm files issue

#5 Post by HerrBert »

First of all: Thanks for reply.
wjaguar wrote:
HerrBert wrote:I've updated mtpaint on my Slackos to 3.44.73 due to translation issues with the delivered versions...
The "issues" being what exactly?
Not related to mtpaint. I guess mtpaint was not configured with intl on slacko 5.7.0 and langpack delivers wrong version for slacko 6.3.2. Solved this issue by compiling the most recent Version of mtpaint 3.49.19 with international language support today (on slacko 5.7.0).
Given that in my full Slackware install, I find none of the three things you listed, I would refrain from calling any of them a "common" anything. ;)
Anyhow, I could not reproduce anything like the problem you describe; neither GQview nor GIMP nor ImageMagick nor Okular have the slightest problem with a PNM produced by scanning (XSane) and then modified and saved in mtPaint.
Hmmm... I don't know anything about full Slackware installs. May be an issue with Puppy Linux in general. And, as i said before, i can open/edit these files with mtpaint.
But:
I understand that, at least viewnior, uses gtk.pixbuf.loaders. And in my understanding, /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-pnm.so supports "image/x-portable-anymap" and "image/x-portable-pixmap". And, i repeat, neither rox's preview nor viewnior can access these .ppm files (see screenshots)
The suggestion is, provide an example of the PNM file that your viewers cannot display. Things of this sort cannot be sorted out in the abstract.
Due to limited filesize of uploaded Attachements, this won't be possible...

I would mark this thread solved. The mtpaint Handbook Appendix A.2: Supported File Types does not mention .pnm Files to be supported.
Though this Handbook seems to be quite outdated (latest entry in Document History is December 2011 - Edition 3.40) i guess, saving to .pnm File is not supported and saving to .ppm File not documented...
Attachments
Screenshot_2.png
Bunker-original.ppm is an unmodified copy (Bunker-original.pnm saved as .ppm)
(21.89 KiB) Downloaded 176 times
Screenshot_1.png
(13.68 KiB) Downloaded 176 times
wjaguar
Posts: 359
Joined: Wed 21 Jun 2006, 14:16

Re: mtpaint and .pnm files issue

#6 Post by wjaguar »

HerrBert wrote:I understand that, at least viewnior, uses gtk.pixbuf.loaders. And in my understanding, /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-pnm.so supports "image/x-portable-anymap" and "image/x-portable-pixmap". And, i repeat, neither rox's preview nor viewnior can access these .ppm files (see screenshots)
Thing is, GQview does use that same pathway too, and here it never had the least problem.
Which version of gdk-pixbuf2 is installed on your system?
Due to limited filesize of uploaded Attachements, this won't be possible...
Given that the problem, whatever it is, is with files edited in mtPaint anyway, you could crop a test example in mtPaint to something small enough.
And there are alternative ways of reporting a bug, that allow for largish attachments: https://github.com/wjaguar/mtPaint/issues or email (see http://mtpaint.sourceforge.net/contact.html).
Because when such an incompatibility suddenly gets observed, it needs be unraveled to its root cause. All kinds of weird breakage in external libraries had happened over the years, some needed workarounds, some others, warnings against specific versions.
does not mention .pnm Files to be supported.
For the simple reason of there being no such animal. "PNM" is an umbrella term for the entire set of Netpbm's formats: PAM, PBM, PGM and PPM. Specifically XSane saves into a PPM if doing it in color mode, PGM in grayscale, PBM in lineart, even if calling the whole menagerie "PNM" the entire time.
What mtPaint actually allows to save with a ".pnm" extension, is a PPM; other subformats get their proper file extensions.
User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#7 Post by tallboy »

HerrBert, without trouble and confusion, there would not be a forum! We thank you! :D
True freedom is a live Puppy on a multisession CD/DVD.
Post Reply