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

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

[Octave-bug-tracker] [bug #62974] The `isa` function returned by imforma


From: Maged Rifaat
Subject: [Octave-bug-tracker] [bug #62974] The `isa` function returned by imformats doesn't work
Date: Sun, 28 Aug 2022 16:17:46 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?62974>

                 Summary: The `isa` function returned by imformats doesn't
work
                 Project: GNU Octave
               Submitter: magedrifaat
               Submitted: Sun 28 Aug 2022 08:17:45 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 7.2.0
         Discussion Lock: Any
        Operating System: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 28 Aug 2022 08:17:45 PM UTC By: Maged Rifaat <magedrifaat>
The imformats function returns a struct with function handles to handle a
specific format. One of them is a field `isa` which should be a function
handle that returns true if supplied with a file name that represents an image
of the given format.

For example:

png_format = imformats("png");
ispng = png_format.isa;
tf = ispng ("example.png")

In this case, tf should be a logical 1 but it isn't.

The problem seems to be a typo in the function isa_magick in imformats.m:

function bool = isa_magick (coder, filename)
  bool = false;
  try
    info = __magick_ping__ (filename, 1);
    bool = strcmp (coder, info.Format);
  end_try_catch
endfunction


The code attempts to use info.Format with a capital F in `Format`, while the
internal `__magick_ping__` function returns a struct with lower case `format`.






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Sun 28 Aug 2022 08:17:45 PM UTC  Name: fix_isa.patch  Size: 690B   By:
magedrifaat
A patch to fix the typo
<http://savannah.gnu.org/bugs/download.php?file_id=53614>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62974>

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




reply via email to

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