octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #40267] imread ('default.img') causes segfault


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #40267] imread ('default.img') causes segfault
Date: Sat, 23 Nov 2013 23:04:54 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131030 Firefox/17.0 Iceweasel/17.0.10

Follow-up Comment #5, bug #40267 (project octave):

By the way, I generated the PNG image with the following:


[old_img, old_map] = imread ("default.img");

new_map = zeros (numel (unique (old_img(:))), 3);
new_img = zeros (size (old_img), "uint8");

n = 0;
for row = 1:rows(old_map)
  mask = old_img == row;
  if (any (mask(:)))
    new_img(mask) = n++;
    new_map(n,:)  = old_map(row, :);
  endif
endfor
imwrite (new_img, new_map, "new-default.img")


This code also converts the indexed image to uint8 (there's only 56 entries)
and removes unnecessary entries from the colormap. After, I ran pngcrush which
further reduced the size of the png file.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?40267>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]