bugGNU Octave - Bugs: bug #67663, imread fails to read PGM images...

 
 

bug #67663: imread fails to read PGM images with P2 (ASCII) encoding

Submitter:  April <april>
Submitted:  Mon 03 Nov 2025 05:43:23 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  April Open/Closed:  * Open
Release:  * 9.4.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Wed 05 Nov 2025 12:17:46 AM UTC, comment #4: 

Sorry,

I didn't notice this issue.

I'll report it to the right community.

Thanks for pointing it out!

April

April <april>
Tue 04 Nov 2025 07:16:15 PM UTC, comment #3: 

Note, Octave uses GraphicsMagick not ImageMagick.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 04 Nov 2025 03:28:55 AM UTC, comment #2: 

I have checked this bug.

This bug seems to be caused by the upstream ImageMagick package.

To read the picture I offered, you can open it with vim editor and add a new line at the last line.

I have already posted an issue on their repo and tried to make a pr to fix the problem.

April

April <april>
Mon 03 Nov 2025 08:36:10 PM UTC, comment #1: 

On my Fedora 43 computer neither GraphicsMagick (1.3.45-5.fc43) nor ImageMagick (7.1.1.47-3.fc43) can read this image:


$ gm identify -verbose ./512x512_p2.pgm
gm identify: Unexpected end-of-file (./512x512_p2.pgm).
gm identify: Request did not return an image.

$ identify -verbose ./512x512_p2.pgm
identify: unable to read image data `./512x512_p2.pgm' @ error/pnm.c/ReadPNMImage/1591.


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 03 Nov 2025 05:43:23 PM UTC, original submission:  

Hi,

The imread function successfully reads PGM files with P5 (binary) encoding but fails to read those with P2 (ASCII) encoding.

When attempting to load a P2 PGM file, the function throws an error.

error: Magick++ exception: Magick: Unexpected end-of-file

I don't know if it is a Magick version problem or a problem caused by octave-call.

Thanks,
April

April <april>

 

Attached Files

Attached Files
file #57765:  512x512_p2.pgm added by april (917KiB - image/x-portable-graymap)

(Note: upload size limit is set to 16MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by april (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    History

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-11-03 april Attached File- Added 512x512_p2.pgm, #57765

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code