octave-maintainers
[Top][All Lists]
Advanced

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

RE: need one more test in matlab for imformats


From: Marco Vassallo
Subject: RE: need one more test in matlab for imformats
Date: Tue, 9 Jul 2013 08:51:52 +0200



> From: address@hidden
> Date: Tue, 9 Jul 2013 02:59:54 +0100
> Subject: Re: need one more test in matlab for imformats
> To: address@hidden
> CC: address@hidden
>
> On 8 July 2013 18:26, Brandon Miles <address@hidden> wrote:
> > Hi Carnë
> >
> > I found they were both 1x1 doubles, so they were not read. My output is
> > below from Matlab 2012b, win XP:
> >
> >
> > What are the values of img1 and img2? Is any of them the actual image
> > (a large matrix) or the size of the filename?
> >
> > Brandon
> >
> >>> fmt = imformats ('bmp');
> > fmt.read = @(x) size(x);
> > fmt.isa = @(x) true;
> > imformats ('update', 'bmp', fmt);
> > img1 = imread ('Test_BMP', 'bmp');
>
> This should have been a jpeg file with no file extension, trying to
> force a different format (bmp). Was Test_BMP a bmp or jpeg image with
> no extension?

I have tried with a .jpg file with and without file extension, but the result
is always the same:

>> fmt = imformats ('bmp');
fmt.read = @(x) size(x);
fmt.isa = @(x) true;
imformats ('update', 'bmp', fmt);
img1 = imread ('DSC02538.jpg', 'bmp')

fmt = imformats ('jpg');
fmt.read = @(x) size(x);
fmt.isa = @(x) true;
imformats ('update', 'jpg', fmt);
img2 = imread ('DSC02538.jpg', 'jpg')

img1 =

     1


img2 =

     1

>> whos
  Name      Size            Bytes  Class     Attributes

  fmt       1x1              1152  struct              
  img1      1x1                 8  double              
  img2      1x1                 8  double 

--------------------------------------------------
case without extension

 fmt = imformats ('bmp');
fmt.read = @(x) size(x);
fmt.isa = @(x) true;
imformats ('update', 'bmp', fmt);
img1 = imread ('DSC02538', 'bmp')

fmt = imformats ('jpg');
fmt.read = @(x) size(x);
fmt.isa = @(x) true;
imformats ('update', 'jpg', fmt);
img2 = imread ('DSC02538', 'jpg')

img1 =

     1


img2 =

     1

>> whos
  Name      Size            Bytes  Class     Attributes

  fmt       1x1              1152  struct              
  img1      1x1                 8  double              
  img2      1x1                 8  double 

------------------------------------------------------------------
HTH

Marco
>
> Thank you,
> Carnë

reply via email to

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