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

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

[Octave-bug-tracker] [bug #54064] Behavior of open with unknown or non-e


From: Pantxo Diribarne
Subject: [Octave-bug-tracker] [bug #54064] Behavior of open with unknown or non-existing files
Date: Tue, 5 Jun 2018 18:31:19 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #3, bug #54064 (project octave):

I attached a very simple wrapper around libmagic, that I tested as follows:


im = rand (10,10,3);
fname = "toto.titi";

## Images
fmts = {"png", "tiff", "gif", "jpeg"};
for ii = 1:numel (fmts)
  fmt = fmts{ii}
  imwrite (im, fname, fmt);
  disp (fileinfo (fname))
  disp ("")
endfor

## Octave generated data
fmts = {"-v7", "-binary", "-text", "-zip", "-hdf5"};
for ii = 1:numel (fmts)
  fmt = fmts{ii}
  save (fmt, fname, "im");
  disp (fileinfo (fname))
  disp ("")
endfor


and here is the result


fmt = png
PNG image data, 10 x 10, 8-bit/color RGB, non-interlaced

fmt = tiff
TIFF image data, little-endian

fmt = gif
GIF image data, version 89a, 10 x 10

fmt = jpeg
JPEG image data, JFIF standard 1.01

fmt = -v7
Matlab v5 mat-file (little endian) version 0x0100

fmt = -binary
Octave binary data (little endian)

fmt = -text
ASCII text

fmt = -zip
gzip compressed data, from Unix

fmt = -hdf5
Hierarchical Data Format (version 5) data



If you want to test, you need to install the developper version of libmagic
and compile fileinfo.cc as follows


mkoctfile -lmagic ./fileinfo.cc




(file #44307)
    _______________________________________________________

Additional Item Attachment:

File name: fileinfo.cc                    Size:1 KB


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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