default services conflit ?
340
old.vendor/lsolesen/pel/test/imagetests/COPYING
Normal file
@@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
335
old.vendor/lsolesen/pel/test/imagetests/CanonEos650dTest.php
Normal file
@@ -0,0 +1,335 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
|
||||
class CanonEos650dTest extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/canon-eos-650d.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(9, count($ifd0->getEntries()));
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals('Canon', $entry->getValue());
|
||||
$this->assertEquals('Canon', $entry->getText());
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals('Canon EOS 650D', $entry->getValue());
|
||||
$this->assertEquals('Canon EOS 650D', $entry->getText());
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(1, $entry->getValue());
|
||||
$this->assertEquals('top - left', $entry->getText());
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 72,
|
||||
1 => 1
|
||||
], $entry->getValue());
|
||||
$this->assertEquals('72/1', $entry->getText());
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 72,
|
||||
1 => 1
|
||||
], $entry->getValue());
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(2, $entry->getValue());
|
||||
$this->assertEquals('Inch', $entry->getText());
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals(1509974253, $entry->getValue());
|
||||
$this->assertEquals('2017:11:06 13:17:33', $entry->getText());
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 2);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 29);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 1,
|
||||
1 => 800
|
||||
], $entry->getValue());
|
||||
$this->assertEquals('1/800 sec.', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 63,
|
||||
1 => 10
|
||||
], $entry->getValue());
|
||||
$this->assertEquals('f/6.3', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals(2.3, $entry->getValue());
|
||||
$this->assertEquals('Exif Version 2.3', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals(1497623444, $entry->getValue());
|
||||
$this->assertEquals('2017:06:16 14:30:44', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals(1497623444, $entry->getValue());
|
||||
$this->assertEquals('2017:06:16 14:30:44', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals("\x01\x02\x03\0", $entry->getValue());
|
||||
$this->assertEquals('Y Cb Cr -', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(37378); // ApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 352256,
|
||||
1 => 65536
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/6.4');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 0,
|
||||
1 => 1
|
||||
], $entry->getValue());
|
||||
$this->assertEquals('0.0', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(5, $entry->getValue());
|
||||
$this->assertEquals('Pattern', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(16, $entry->getValue());
|
||||
$this->assertEquals('Flash did not fire, compulsory flash mode.', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 600,
|
||||
1 => 1
|
||||
], $entry->getValue());
|
||||
$this->assertEquals('600.0 mm', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertNull($entry);
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
|
||||
$expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($expected, $entry->getValue());
|
||||
|
||||
$expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($expected, $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals(1, $entry->getValue());
|
||||
$this->assertEquals('FlashPix Version 1.0', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(1, $entry->getValue());
|
||||
$this->assertEquals('sRGB', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(41488); // FocalPlaneResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(2, $entry->getValue());
|
||||
$this->assertEquals('Inch', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(0, $entry->getValue());
|
||||
$this->assertEquals('Normal process', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(0, $entry->getValue());
|
||||
$this->assertEquals('Auto exposure', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(0, $entry->getValue());
|
||||
$this->assertEquals('Auto white balance', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(0, $entry->getValue(), 0);
|
||||
$this->assertEquals('Standard', $entry->getText());
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 2);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(2, count($ifd0_0_0->getEntries()));
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals('R98', $entry->getValue());
|
||||
$this->assertEquals('R98', $entry->getText());
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals(1, $entry->getValue());
|
||||
$this->assertEquals('Interoperability Version 1.0', $entry->getText());
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(0, count($ifd0_0_0->getSubIfds()));
|
||||
|
||||
$this->assertEquals('', $ifd0_0_0->getThumbnailData());
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals('', $ifd0_0->getThumbnailData());
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals('', $ifd0->getThumbnailData());
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(0, $entry->getValue());
|
||||
$this->assertEquals('0', $entry->getText());
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 72,
|
||||
1 => 1
|
||||
], $entry->getValue());
|
||||
$this->assertEquals('72/1', $entry->getText());
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals([
|
||||
0 => 72,
|
||||
1 => 1
|
||||
], $entry->getValue());
|
||||
$this->assertEquals('72/1', $entry->getText());
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals(2, $entry->getValue());
|
||||
$this->assertEquals('Inch', $entry->getText());
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(0, count($ifd1->getSubIfds()));
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/canon-eos-650d-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
/* Start of IDF $ifd0_mn */
|
||||
$ifd0_mn = $ifd0_0->getSubIfd(5); // IFD MakerNotes
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_mn);
|
||||
|
||||
$entry = $ifd0_mn->getEntry(6); // ImageType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals('Canon EOS 650D', $entry->getValue());
|
||||
|
||||
$entry = $ifd0_mn->getEntry(7); // FirmwareVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals('Firmware Version 1.0.4', $entry->getValue());
|
||||
|
||||
/* Start of IDF $ifd0_mn_cs. */
|
||||
$ifd0_mn_cs = $ifd0_mn->getSubIfd(6); // CameraSettings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_mn_cs);
|
||||
$this->assertEquals(37, count($ifd0_mn_cs->getEntries()));
|
||||
|
||||
$entry = $ifd0_mn_cs->getEntry(1); // MacroMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySShort', $entry);
|
||||
$this->assertEquals('2', $entry->getValue());
|
||||
$this->assertEquals('Normal', $entry->getText());
|
||||
|
||||
$entry = $ifd0_mn_cs->getEntry(9); // RecordMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySShort', $entry);
|
||||
$this->assertEquals('6', $entry->getValue());
|
||||
$this->assertEquals('CR2', $entry->getText());
|
||||
|
||||
$entry = $ifd0_mn_cs->getEntry(22); // LensModel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySShort', $entry);
|
||||
$this->assertEquals(747, $entry->getValue());
|
||||
// Tamron 150-600mm G2
|
||||
$this->assertEquals('Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens', $entry->getText());
|
||||
|
||||
$this->assertEquals(0, count(Pel::getExceptions()));
|
||||
}
|
||||
}
|
||||
416
old.vendor/lsolesen/pel/test/imagetests/CanonIxusIITest.php
Normal file
@@ -0,0 +1,416 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CanonIxusIITest extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/canon-ixus-ii.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 8);
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Canon');
|
||||
$this->assertEquals($entry->getText(), 'Canon');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Canon DIGITAL IXUS II');
|
||||
$this->assertEquals($entry->getText(), 'Canon DIGITAL IXUS II');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'right - top');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1089488628);
|
||||
$this->assertEquals($entry->getText(), '2004:07:10 19:43:48');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'centered');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 29);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 1,
|
||||
1 => 30
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/30 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 32,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/3.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.2);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1089488628);
|
||||
$this->assertEquals($entry->getText(), '2004:07:10 19:43:48');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1089488628);
|
||||
$this->assertEquals($entry->getText(), '2004:07:10 19:43:48');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2/1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37377); // ShutterSpeedValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 157,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '157/32 sec. (APEX: 5)');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37378); // ApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 107,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/3.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => - 1,
|
||||
1 => 3
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '-0.3');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 107,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '107/32');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Pattern');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 16);
|
||||
$this->assertEquals($entry->getText(), 'Flash did not fire, compulsory flash mode.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 215,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '6.7 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertNull($entry);
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
|
||||
$expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
|
||||
$expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getText(), $expected);
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 640);
|
||||
$this->assertEquals($entry->getText(), '640');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 480);
|
||||
$this->assertEquals($entry->getText(), '480');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41486); // FocalPlaneXResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 640000,
|
||||
1 => 208
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '640000/208');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41487); // FocalPlaneYResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 480000,
|
||||
1 => 156
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '480000/156');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41488); // FocalPlaneResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41495); // SensingMethod
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'One-chip color area sensor');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal process');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Manual exposure');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Manual white balance');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41988); // DigitalZoomRatio
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2048,
|
||||
1 => 2048
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2048/2048');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Standard');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 2);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 4);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(4097); // RelatedImageWidth
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 640);
|
||||
$this->assertEquals($entry->getText(), '640');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(4098); // RelatedImageLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 480);
|
||||
$this->assertEquals($entry->getText(), '480');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/canon-ixus-ii-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
/* Start of IDF $ifd0_mn */
|
||||
$ifd0_mn = $ifd0_0->getSubIfd(5); // IFD MakerNotes
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_mn);
|
||||
|
||||
$entry = $ifd0_mn->getEntry(6); // ImageType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'IMG:DIGITAL IXUS II JPEG');
|
||||
|
||||
$entry = $ifd0_mn->getEntry(7); // FirmwareVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Firmware Version 1.00');
|
||||
|
||||
$entry = $ifd0_mn->getEntry(8); // FileNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), '1202044');
|
||||
|
||||
/* Start of IDF $ifd0_mn_cs. */
|
||||
$ifd0_mn_cs = $ifd0_mn->getSubIfd(6); // CameraSettings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_mn_cs);
|
||||
$this->assertEquals(count($ifd0_mn_cs->getEntries()), 37);
|
||||
|
||||
$entry = $ifd0_mn_cs->getEntry(1); // MacroMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), '2');
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_mn_cs->getEntry(9); // RecordMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), '1');
|
||||
$this->assertEquals($entry->getText(), 'JPEG');
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,414 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CanonPowershotS60Test extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/canon-powershot-s60.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 8);
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Canon');
|
||||
$this->assertEquals($entry->getText(), 'Canon');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Canon PowerShot S60');
|
||||
$this->assertEquals($entry->getText(), 'Canon PowerShot S60');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'top - left');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1097316018);
|
||||
$this->assertEquals($entry->getText(), '2004:10:09 10:00:18');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'centered');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 29);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 1,
|
||||
1 => 8
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/8 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 53,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/5.3');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.2);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1097316018);
|
||||
$this->assertEquals($entry->getText(), '2004:10:09 10:00:18');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1097316018);
|
||||
$this->assertEquals($entry->getText(), '2004:10:09 10:00:18');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2/1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37377); // ShutterSpeedValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 96,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '96/32 sec. (APEX: 2)');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37378); // ApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 154,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/5.3');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 3
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 154,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '154/32');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Pattern');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 16);
|
||||
$this->assertEquals($entry->getText(), 'Flash did not fire, compulsory flash mode.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 662,
|
||||
1 => 32
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '20.7 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertNull($entry);
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
$expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$expected = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getText(), $expected);
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 640);
|
||||
$this->assertEquals($entry->getText(), '640');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 480);
|
||||
$this->assertEquals($entry->getText(), '480');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41486); // FocalPlaneXResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 640000,
|
||||
1 => 283
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '640000/283');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41487); // FocalPlaneYResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 480000,
|
||||
1 => 212
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '480000/212');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41488); // FocalPlaneResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41495); // SensingMethod
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'One-chip color area sensor');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal process');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto exposure');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto white balance');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41988); // DigitalZoomRatio
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2592,
|
||||
1 => 2592
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2592/2592');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Standard');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 2);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 4);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(4097); // RelatedImageWidth
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 640);
|
||||
$this->assertEquals($entry->getText(), '640');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(4098); // RelatedImageLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 480);
|
||||
$this->assertEquals($entry->getText(), '480');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 180,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '180/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/canon-powershot-s60-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
/* Start of IDF $ifd0_mn */
|
||||
$ifd0_mn = $ifd0_0->getSubIfd(5); // IFD MakerNotes
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_mn);
|
||||
|
||||
$entry = $ifd0_mn->getEntry(6); // ImageType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'IMG:PowerShot S60 JPEG');
|
||||
|
||||
$entry = $ifd0_mn->getEntry(7); // FirmwareVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Firmware Version 1.00');
|
||||
|
||||
$entry = $ifd0_mn->getEntry(8); // FileNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), '1000041');
|
||||
|
||||
/* Start of IDF $ifd0_mn_cs. */
|
||||
$ifd0_mn_cs = $ifd0_mn->getSubIfd(6); // CameraSettings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_mn_cs);
|
||||
$this->assertEquals(count($ifd0_mn_cs->getEntries()), 37);
|
||||
|
||||
$entry = $ifd0_mn_cs->getEntry(1); // MacroMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), '2');
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_mn_cs->getEntry(9); // RecordMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), '1');
|
||||
$this->assertEquals($entry->getText(), 'JPEG');
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
419
old.vendor/lsolesen/pel/test/imagetests/LeicaDLuxTest.php
Normal file
@@ -0,0 +1,419 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class LeicaDLuxTest extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/leica-d-lux.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 10);
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'LEICA');
|
||||
$this->assertEquals($entry->getText(), 'LEICA');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'D-LUX');
|
||||
$this->assertEquals($entry->getText(), 'D-LUX');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'top - left');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(305); // Software
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Ver1.06');
|
||||
$this->assertEquals($entry->getText(), 'Ver1.06');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1099994128);
|
||||
$this->assertEquals($entry->getText(), '2004:11:09 09:55:28');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'co-sited');
|
||||
|
||||
$entry = $ifd0->getEntry(50341); // PrintIM
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x50\x72\x69\x6e\x74\x49\x4d\0\x30\x32\x35\x30\0\0\x0e\0\x01\0\x16\0\x16\0\x02\0\0\0\0\0\x03\0\x64\0\0\0\x07\0\0\0\0\0\x08\0\0\0\0\0\x09\0\0\0\0\0\x0a\0\0\0\0\0\x0b\0\xac\0\0\0\x0c\0\0\0\0\0\x0d\0\0\0\0\0\x0e\0\xc4\0\0\0\0\x01\x05\0\0\0\x01\x01\x01\0\0\0\x10\x01\x80\0\0\0\x09\x11\0\0\x10\x27\0\0\x0b\x0f\0\0\x10\x27\0\0\x37\x05\0\0\x10\x27\0\0\xb0\x08\0\0\x10\x27\0\0\x01\x1c\0\0\x10\x27\0\0\x5e\x02\0\0\x10\x27\0\0\x8b\0\0\0\x10\x27\0\0\xcb\x03\0\0\x10\x27\0\0\xe5\x1b\0\0\x10\x27\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '(undefined)');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 37);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 10,
|
||||
1 => 1000
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/100 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 97,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/9.7');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34850); // ExposureProgram
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Normal program');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34855); // ISOSpeedRatings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 100);
|
||||
$this->assertEquals($entry->getText(), '100');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.2);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1099994128);
|
||||
$this->assertEquals($entry->getText(), '2004:11:09 09:55:28');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1099994128);
|
||||
$this->assertEquals($entry->getText(), '2004:11:09 09:55:28');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0" . '');
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 21,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '21/10');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37377); // ShutterSpeedValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 6644,
|
||||
1 => 1000
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '6644/1000 sec. (APEX: 10)');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37378); // ApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 66,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/9.8');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 100
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 30,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '30/10');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 3);
|
||||
$this->assertEquals($entry->getText(), 'Spot');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37384); // LightSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Daylight');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 24);
|
||||
$this->assertEquals($entry->getText(), 'Flash did not fire, auto mode.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 88,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '8.8 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x4c\x45\x49\x43\x41\0\0\0\x0b\0\x01\0\x03\0\x01\0\0\0\x03\0\0\0\x02\0\x07\0\x04\0\0\0\x30\x31\x30\x30\x03\0\x03\0\x01\0\0\0\x01\0\0\0\x07\0\x03\0\x01\0\0\0\x01\0\0\0\x0f\0\x01\0\x02\0\0\0\0\x10\0\0\x1a\0\x03\0\x01\0\0\0\x02\0\0\0\x1c\0\x03\0\x01\0\0\0\x02\0\0\0\x1f\0\x03\0\x01\0\0\0\x01\0\0\0\x20\0\x03\0\x01\0\0\0\x02\0\0\0\x21\0\x07\0\x72\0\0\0\x5e\x04\0\0\x22\0\x03\0\x01\0\0\0\0\0\0\0\x57\x42\x02\x62\x01\x36\0\xb9\0\x92\0\xa8\0\x8c\0\xdc\0\xa0\0\x4b\x01\x9c\x01\xd5\x02\x3b\x01\x1c\x02\x44\x01\x1d\x0b\xab\x1b\x6c\x16\xb8\0\0\x41\x46\x01\x96\x04\x8e\x20\x06\0\0\x53\x54\0\0\0\0\0\0\x01\x24\0\0\0\0\0\0\0\x05\0\x05\0\0\x41\x45\x06\xa7\0\x4c\0\0\x02\x28\x09\x01\0\x93\x01\x44\0\0\x08\x08\x08\x08\x03\x03\0\0\0\xe0\0\0\x20\x20\0\x0a\0\0\x45\x50\x01\x0a\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '256 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 640);
|
||||
$this->assertEquals($entry->getText(), '640');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 480);
|
||||
$this->assertEquals($entry->getText(), '480');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41495); // SensingMethod
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'One-chip color area sensor');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41729); // SceneType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01");
|
||||
$this->assertEquals($entry->getText(), 'Directly photographed');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41730); // CFAPattern
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\0\x02\0\x02\0\x01\x01\x02");
|
||||
$this->assertEquals($entry->getText(), '(undefined)');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal process');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto exposure');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto white balance');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41988); // DigitalZoomRatio
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0/10');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41989); // FocalLengthIn35mmFilm
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 53);
|
||||
$this->assertEquals($entry->getText(), '53');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Standard');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41991); // GainControl
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41992); // Contrast
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41993); // Saturation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41994); // Sharpness
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41996); // SubjectDistanceRange
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Close view');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 1);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 2);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 5);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd1->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'co-sited');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/leica-d-lux-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
166
old.vendor/lsolesen/pel/test/imagetests/NikonCoolscanIVTest.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class NikonCoolscanIVTest extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/nikon-coolscan-iv.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 6);
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'Nikon');
|
||||
$this->assertEquals($entry->getText(), 'Nikon');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2000,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2000/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2000,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2000/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1090023875);
|
||||
$this->assertEquals($entry->getText(), '2004:07:17 00:24:35');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'centered');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 2);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 7);
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.1);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x02\0\x01\0\x07\0\x04\0\0\0\x30\x31\x30\x30\x10\x0e\x04\0\x01\0\0\0\x16\x01\0\0\0\0\0\0\x05\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '32 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 960);
|
||||
$this->assertEquals($entry->getText(), '960');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 755);
|
||||
$this->assertEquals($entry->getText(), '755');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
$ifd0_1 = $ifd0->getSubIfd(3); // IFD GPS
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_1);
|
||||
|
||||
/* Start of IDF $ifd0_1. */
|
||||
$this->assertEquals(count($ifd0_1->getEntries()), 0);
|
||||
|
||||
/* Sub IFDs of $ifd0_1. */
|
||||
$this->assertEquals(count($ifd0_1->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_1->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_2 = $ifd0_1->getNextIfd();
|
||||
$this->assertNull($ifd0_2);
|
||||
/* End of IFD $ifd0_1. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertNull($ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
313
old.vendor/lsolesen/pel/test/imagetests/NikonE5000Test.php
Normal file
@@ -0,0 +1,313 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class NikonE5000Test extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/nikon-e5000.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 9);
|
||||
|
||||
$entry = $ifd0->getEntry(270); // ImageDescription
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'NIKON');
|
||||
$this->assertEquals($entry->getText(), 'NIKON');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'E5000');
|
||||
$this->assertEquals($entry->getText(), 'E5000');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 300,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '300/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 300,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '300/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(305); // Software
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'E5000v1.6');
|
||||
$this->assertEquals($entry->getText(), 'E5000v1.6');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1021992832);
|
||||
$this->assertEquals($entry->getText(), '2002:05:21 14:53:52');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'centered');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 2);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 22);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 1642036,
|
||||
1 => 100000000
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/60 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 28,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/2.8');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34850); // ExposureProgram
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Normal program');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34855); // ISOSpeedRatings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 100);
|
||||
$this->assertEquals($entry->getText(), '100');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.1);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1021992832);
|
||||
$this->assertEquals($entry->getText(), '2002:05:21 14:53:52');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1021992832);
|
||||
$this->assertEquals($entry->getText(), '2002:05:21 14:53:52');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 3,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '3/1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Pattern');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37384); // LightSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Unknown');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Flash did not fire.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 71,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '7.1 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x15\0\x01\0\x07\0\x04\0\0\0\0\x01\0\0\x02\0\x03\0\x02\0\0\0\0\0\0\0\x03\0\x02\0\x06\0\0\0\xbc\x03\0\0\x04\0\x02\0\x08\0\0\0\xc2\x03\0\0\x05\0\x02\0\x0d\0\0\0\xca\x03\0\0\x06\0\x02\0\x07\0\0\0\xd8\x03\0\0\x07\0\x02\0\x07\0\0\0\xe0\x03\0\0\x08\0\x02\0\x0d\0\0\0\xe8\x03\0\0\x0a\0\x05\0\x01\0\0\0\xf6\x03\0\0\x0f\0\x02\0\x07\0\0\0\xfe\x03\0\0\x11\0\x04\0\x01\0\0\0\x14\x05\0\0\x80\0\x02\0\x0e\0\0\0\x06\x04\0\0\x82\0\x02\0\x0d\0\0\0\x14\x04\0\0\x85\0\x05\0\x01\0\0\0\x22\x04\0\0\x86\0\x05\0\x01\0\0\0\x2a\x04\0\0\x88\0\x07\0\x04\0\0\0\0\0\0\0\x8f\0\x02\0\x11\0\0\0\x32\x04\0\0\x94\0\x08\0\x01\0\0\0\0\0\0\0\x95\0\x02\0\x05\0\0\0\x44\x04\0\0\0\x0e\x07\0\xca\0\0\0\x4a\x04\0\0\x10\x0e\x04\0\x01\0\0\0\x72\x05\0\0\0\0\0\0\x43\x4f\x4c\x4f\x52\0\x46\x49\x4e\x45\x20\x20\x20\0\x41\x55\x54\x4f\x20\x20\x20\x20\x20\x20\x20\x20\0\x31\x41\x55\x54\x4f\x20\x20\0\0\x41\x46\x2d\x43\x20\x20\0\x3a\x4e\x4f\x52\x4d\x41\x4c\x20\x20\x20\x20\x20\x20\0\0\x80\x22\0\0\xe8\x03\0\0\x41\x55\x54\x4f\x20\x20\0\0\x41\x55\x54\x4f\x20\x20\x20\x20\x20\x20\x20\x20\x20\0\x4f\x46\x46\x20\x20\x20\x20\x20\x20\x20\x20\x20\0\x20\0\0\0\0\0\0\0\0\x01\0\0\0\x01\0\0\0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\0\x20\x4f\x46\x46\x20\0\x20\x50\x72\x69\x6e\x74\x49\x4d\0\x30\x31\x30\x30\0\0\x0d\0\x01\0\x16\0\x16\0\x02\0\x01\0\0\0\x03\0\x5e\0\0\0\x07\0\0\0\0\0\x08\0\0\0\0\0\x09\0\0\0\0\0\x0a\0\0\0\0\0\x0b\0\xa6\0\0\0\x0c\0\0\0\0\0\x0d\0\0\0\0\0\x0e\0\xbe\0\0\0\0\x01\x05\0\0\0\x01\x01\x01\0\0\0\x09\x11\0\0\x10\x27\0\0\x0b\x0f\0\0\x10\x27\0\0\x97\x05\0\0\x10\x27\0\0\xb0\x08\0\0\x10\x27\0\0\x01\x1c\0\0\x10\x27\0\0\x5e\x02\0\0\x10\x27\0\0\x8b\0\0\0\x10\x27\0\0\xcb\x03\0\0\x10\x27\0\0\xe5\x1b\0\0\x10\x27\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x06\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '604 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1600);
|
||||
$this->assertEquals($entry->getText(), '1600');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1200);
|
||||
$this->assertEquals($entry->getText(), '1200');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41729); // SceneType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01");
|
||||
$this->assertEquals($entry->getText(), 'Directly photographed');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
$ifd0_1 = $ifd0->getSubIfd(3); // IFD GPS
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_1);
|
||||
|
||||
/* Start of IDF $ifd0_1. */
|
||||
$this->assertEquals(count($ifd0_1->getEntries()), 0);
|
||||
|
||||
/* Sub IFDs of $ifd0_1. */
|
||||
$this->assertEquals(count($ifd0_1->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_1->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_2 = $ifd0_1->getNextIfd();
|
||||
$this->assertNull($ifd0_2);
|
||||
/* End of IFD $ifd0_1. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/nikon-e5000-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
$exceptions = Pel::getExceptions();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelException', $exceptions[0]);
|
||||
$this->assertEquals($exceptions[0]->getMessage(), 'Found trailing content after EOI: 1396 bytes');
|
||||
}
|
||||
}
|
||||
334
old.vendor/lsolesen/pel/test/imagetests/NikonE950Test.php
Normal file
@@ -0,0 +1,334 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class NikonE950Test extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/nikon-e950.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 10);
|
||||
|
||||
$entry = $ifd0->getEntry(270); // ImageDescription
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'NIKON');
|
||||
$this->assertEquals($entry->getText(), 'NIKON');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'E950');
|
||||
$this->assertEquals($entry->getText(), 'E950');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'top - left');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 300,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '300/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 300,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '300/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(305); // Software
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'v981p-78');
|
||||
$this->assertEquals($entry->getText(), 'v981p-78');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 978276013);
|
||||
$this->assertEquals($entry->getText(), '2000:12:31 15:20:13');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'co-sited');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 23);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 10,
|
||||
1 => 1120
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/112 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 60,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/6.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34850); // ExposureProgram
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Normal program');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34855); // ISOSpeedRatings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 80);
|
||||
$this->assertEquals($entry->getText(), '80');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.1);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 978276013);
|
||||
$this->assertEquals($entry->getText(), '2000:12:31 15:20:13');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 978276013);
|
||||
$this->assertEquals($entry->getText(), '2000:12:31 15:20:13');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 4,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '4/1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 26,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '26/10');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Pattern');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37384); // LightSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Unknown');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Flash did not fire.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 158,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '15.8 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x4e\x69\x6b\x6f\x6e\0\x01\0\x0b\0\x02\0\x02\0\x06\0\0\0\x26\x04\0\0\x03\0\x03\0\x01\0\0\0\x0c\0\0\0\x04\0\x03\0\x01\0\0\0\x01\0\0\0\x05\0\x03\0\x01\0\0\0\0\0\0\0\x06\0\x03\0\x01\0\0\0\0\0\0\0\x07\0\x03\0\x01\0\0\0\0\0\0\0\x08\0\x05\0\x01\0\0\0\x2c\x04\0\0\x09\0\x02\0\x14\0\0\0\x34\x04\0\0\x0a\0\x05\0\x01\0\0\0\x48\x04\0\0\x0b\0\x03\0\x01\0\0\0\0\0\0\0\0\x0f\x04\0\x1e\0\0\0\x50\x04\0\0\0\0\0\0\x30\x38\x2e\x30\x30\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\0\0\0\x01\x3e\0\x80\x01\x58\0\0\0\0\xff\x01\0\0\0\0\x0c\xe5\x10\x8c\0\0\0\0\x0a\x5b\0\0\x18\x6a\0\0\x23\x04\0\0\x11\x16\0\0\x11\x16\0\0\x1f\x05\x0c\x9f\0\x2f\0\0\0\0\x01\xcb\x02\x27\x02\x7b\x02\xd8\x03\x6a\x08\x5c\0\0\0\0\x10\x0e\x15\0\0\x01\x60\0\0\x30\0\0\0\x10\0\0\x5b\x18\x02\0\x48\x04\x16\x68\0\x0b\x58\x29\0\x3f\0\0\x15\x19\x15\x1a\x0f\xe1\x42\0\xff\0\x4f\x5d\x32\x0c\xa1\x02\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '308 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1600);
|
||||
$this->assertEquals($entry->getText(), '1600');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1200);
|
||||
$this->assertEquals($entry->getText(), '1200');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41729); // SceneType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01");
|
||||
$this->assertEquals($entry->getText(), 'Directly photographed');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 1);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 2);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 300,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '300/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 300,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '300/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/nikon-e950-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
388
old.vendor/lsolesen/pel/test/imagetests/OlympusC5050zTest.php
Normal file
@@ -0,0 +1,388 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class OlympusC5050zTest extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/olympus-c5050z.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 11);
|
||||
|
||||
$entry = $ifd0->getEntry(270); // ImageDescription
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'OLYMPUS DIGITAL CAMERA ');
|
||||
$this->assertEquals($entry->getText(), 'OLYMPUS DIGITAL CAMERA ');
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'OLYMPUS OPTICAL CO.,LTD');
|
||||
$this->assertEquals($entry->getText(), 'OLYMPUS OPTICAL CO.,LTD');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'C5050Z');
|
||||
$this->assertEquals($entry->getText(), 'C5050Z');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'top - left');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(305); // Software
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'v558-83');
|
||||
$this->assertEquals($entry->getText(), 'v558-83');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), false);
|
||||
$this->assertEquals($entry->getText(), '0000:00:00 00:00:00');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'co-sited');
|
||||
|
||||
$entry = $ifd0->getEntry(50341); // PrintIM
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x50\x72\x69\x6e\x74\x49\x4d\0\x30\x32\x35\x30\0\0\x14\0\x01\0\x14\0\x14\0\x02\0\x01\0\0\0\x03\0\x88\0\0\0\x07\0\0\0\0\0\x08\0\0\0\0\0\x09\0\0\0\0\0\x0a\0\0\0\0\0\x0b\0\xd0\0\0\0\x0c\0\0\0\0\0\x0d\0\0\0\0\0\x0e\0\xe8\0\0\0\0\x01\x01\0\0\0\x01\x01\xff\0\0\0\x02\x01\x83\0\0\0\x03\x01\x83\0\0\0\x04\x01\x80\0\0\0\x05\x01\x83\0\0\0\x06\x01\x83\0\0\0\x07\x01\x80\x80\x80\0\x10\x01\x80\0\0\0\x09\x11\0\0\x10\x27\0\0\x0b\x0f\0\0\x10\x27\0\0\x97\x05\0\0\x10\x27\0\0\xb0\x08\0\0\x10\x27\0\0\x01\x1c\0\0\x10\x27\0\0\x5e\x02\0\0\x10\x27\0\0\x8b\0\0\0\x10\x27\0\0\xcb\x03\0\0\x10\x27\0\0\xe5\x1b\0\0\x10\x27\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '(undefined)');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 32);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 10,
|
||||
1 => 40
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/4 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 26,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/2.6');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34850); // ExposureProgram
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Normal program');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34855); // ISOSpeedRatings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 64);
|
||||
$this->assertEquals($entry->getText(), '64');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.2);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), false);
|
||||
$this->assertEquals($entry->getText(), '0000:00:00 00:00:00');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), false);
|
||||
$this->assertEquals($entry->getText(), '0000:00:00 00:00:00');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2/1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 28,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '28/10');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Pattern');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37384); // LightSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Unknown');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 16);
|
||||
$this->assertEquals($entry->getText(), 'Flash did not fire, compulsory flash mode.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 213,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '21.3 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x4f\x4c\x59\x4d\x50\0\x01\0\x10\0\0\x02\x04\0\x03\0\0\0\xd6\x05\0\0\x01\x02\x03\0\x01\0\0\0\x01\0\0\0\x02\x02\x03\0\x01\0\0\0\0\0\0\0\x03\x02\x03\0\x01\0\0\0\0\0\0\0\x04\x02\x05\0\x01\0\0\0\xe2\x05\0\0\x05\x02\x05\0\x01\0\0\0\xea\x05\0\0\x06\x02\x08\0\x06\0\0\0\xf2\x05\0\0\x07\x02\x02\0\x08\0\0\0\xfe\x05\0\0\x08\x02\x02\0\x34\0\0\0\x06\x06\0\0\x09\x02\x07\0\x20\0\0\0\x42\x06\0\0\0\x03\x03\0\x01\0\0\0\0\0\0\0\x01\x03\x03\0\x01\0\0\0\0\0\0\0\x02\x03\x03\0\x01\0\0\0\x01\0\0\0\x03\x03\x03\0\x01\0\0\0\0\0\0\0\x04\x03\x03\0\x01\0\0\0\0\0\0\0\0\x0f\x07\0\xfe\0\0\0\x62\x06\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\0\0\0\x64\0\0\0\x88\x03\0\0\x64\0\0\0\x03\0\x0d\0\x12\0\x19\0\x38\0\x49\0\x53\x58\x35\x35\x38\0\0\0\x5b\x70\x69\x63\x74\x75\x72\x65\x49\x6e\x66\x6f\x5d\x20\x52\x65\x73\x6f\x6c\x75\x74\x69\x6f\x6e\x3d\x31\x20\x5b\x43\x61\x6d\x65\x72\x61\x20\x49\x6e\x66\x6f\x5d\x20\x54\x79\x70\x65\x3d\x53\x58\x35\x35\x38\0\0\0\0\0\0\0\0\0\x4f\x4c\x59\x4d\x50\x55\x53\x20\x44\x49\x47\x49\x54\x41\x4c\x20\x43\x41\x4d\x45\x52\x41\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x31\xcf\x13\0\0\0\0\x01\xe8\x48\0\0\x03\xb5\0\x01\xe5\xd3\0\0\x14\x55\0\0\x14\x55\x01\0\x1f\0\x0b\xa9\0\x12\x03\x31\x01\0\x01\xc0\x01\xe6\x01\xfc\x01\xe9\xd0\0\0\xe8\x11\x4a\0\0\x14\x14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x0b\x1c\0\0\x40\0\x0b\x19\0\0\0\x67\0\0\0\x67\0\xe8\x16\x49\0\0\0\x12\0\x03\xcb\xa6\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x19\x61\x12\x31\0\x76\x01\x3f\x01\xcf\x02\x59\x01\x15\x02\0\x02\x9c\0\x30\x0b\x95\x0d\x14\x02\0\0\xc9\x03\x8b\x02\0\x01\x6e\x03\x93\x03\xed\x01\x72\x01\0\xd0\x5b\0\x0c\0\x0c\0\x02\x03\x52\0\x01\0\0\0\0\0\x09\0\x32\0\x0a\0\0\0\x01\0\x48\0\x87\0\x64\0\x78\x0e\x0e\x0e\x0e\x11\x11\x11\x11\0\0\0\0\0\0\x14\x1d\x0e\x17\0\0\x0a\0\x1b\0\0\x1a\0\0\0\0\x01\0\x32\x0f\x42\x40\x0f\0\0\x64\x2a\x20\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '600 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 640);
|
||||
$this->assertEquals($entry->getText(), '640');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 480);
|
||||
$this->assertEquals($entry->getText(), '480');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41729); // SceneType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01");
|
||||
$this->assertEquals($entry->getText(), 'Directly photographed');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal process');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto exposure');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Manual white balance');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41988); // DigitalZoomRatio
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 100
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0/100');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Standard');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41991); // GainControl
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41992); // Contrast
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41993); // Saturation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41994); // Sharpness
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 1);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 2);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/olympus-c5050z-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
375
old.vendor/lsolesen/pel/test/imagetests/OlympusC50zTest.php
Normal file
@@ -0,0 +1,375 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class OlympusC50zTest extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/olympus-c50z.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 11);
|
||||
|
||||
$entry = $ifd0->getEntry(270); // ImageDescription
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'OLYMPUS DIGITAL CAMERA ');
|
||||
$this->assertEquals($entry->getText(), 'OLYMPUS DIGITAL CAMERA ');
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'OLYMPUS OPTICAL CO.,LTD');
|
||||
$this->assertEquals($entry->getText(), 'OLYMPUS OPTICAL CO.,LTD');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'X-2,C-50Z ');
|
||||
$this->assertEquals($entry->getText(), 'X-2,C-50Z ');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'top - left');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 144,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '144/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 144,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '144/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(305); // Software
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), '28-1012 ');
|
||||
$this->assertEquals($entry->getText(), '28-1012 ');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), false);
|
||||
$this->assertEquals($entry->getText(), '0000:00:00 00:00:00');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'co-sited');
|
||||
|
||||
$entry = $ifd0->getEntry(50341); // PrintIM
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x50\x72\x69\x6e\x74\x49\x4d\0\x30\x32\x35\x30\0\0\x14\0\x01\0\x12\0\x12\0\x02\0\x01\0\0\0\x03\0\x88\0\0\0\x07\0\0\0\0\0\x08\0\0\0\0\0\x09\0\0\0\0\0\x0a\0\0\0\0\0\x0b\0\xd0\0\0\0\x0c\0\0\0\0\0\x0d\0\0\0\0\0\x0e\0\xe8\0\0\0\0\x01\x01\0\0\0\x01\x01\xff\0\0\0\x02\x01\x80\0\0\0\x03\x01\x80\0\0\0\x04\x01\x80\0\0\0\x05\x01\x80\0\0\0\x06\x01\x80\0\0\0\x07\x01\x80\x80\x80\0\x10\x01\x80\0\0\0\x09\x11\0\0\x10\x27\0\0\x0b\x0f\0\0\x10\x27\0\0\x97\x05\0\0\x10\x27\0\0\xb0\x08\0\0\x10\x27\0\0\x01\x1c\0\0\x10\x27\0\0\x5e\x02\0\0\x10\x27\0\0\x8b\0\0\0\x10\x27\0\0\xcb\x03\0\0\x10\x27\0\0\xe5\x1b\0\0\x10\x27\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '(undefined)');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 30);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 1,
|
||||
1 => 80
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/80 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 45,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/4.5');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34850); // ExposureProgram
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Creative program (biased toward depth of field)');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34855); // ISOSpeedRatings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 80);
|
||||
$this->assertEquals($entry->getText(), '80');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.2);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), false);
|
||||
$this->assertEquals($entry->getText(), '0000:00:00 00:00:00');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), false);
|
||||
$this->assertEquals($entry->getText(), '0000:00:00 00:00:00');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 300,
|
||||
1 => 100
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '300/100');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Pattern');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37384); // LightSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Unknown');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 25);
|
||||
$this->assertEquals($entry->getText(), 'Flash fired, auto mode.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 1883,
|
||||
1 => 100
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '18.8 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x4f\x4c\x59\x4d\x50\0\x01\0\x3e\0\0\x02\x04\0\x03\0\0\0\x24\x0f\0\0\x01\x02\x03\0\x01\0\0\0\x02\0\0\0\x02\x02\x03\0\x01\0\0\0\0\0\0\0\x03\x02\x03\0\x01\0\0\0\0\0\0\0\x04\x02\x05\0\x01\0\0\0\x38\x0f\0\0\x05\x02\x05\0\x01\0\0\0\x40\x0f\0\0\x06\x02\x08\0\x06\0\0\0\x48\x0f\0\0\x07\x02\x02\0\x06\0\0\0\x54\x0f\0\0\x09\x02\x07\0\x20\0\0\0\x5a\x0f\0\0\0\x10\x0a\0\x01\0\0\0\x7c\x0f\0\0\x01\x10\x0a\0\x01\0\0\0\x84\x0f\0\0\x02\x10\x0a\0\x01\0\0\0\x8c\x0f\0\0\x03\x10\x0a\0\x01\0\0\0\x94\x0f\0\0\x04\x10\x03\0\x01\0\0\0\0\0\0\0\x05\x10\x03\0\x02\0\0\0\0\0\0\0\x06\x10\x0a\0\x01\0\0\0\xa4\x0f\0\0\x09\x10\x03\0\x01\0\0\0\x01\0\0\0\x0a\x10\x03\0\x01\0\0\0\0\0\0\0\x0b\x10\x03\0\x01\0\0\0\0\0\0\0\x0c\x10\x05\0\x01\0\0\0\xb8\x0f\0\0\x0d\x10\x03\0\x01\0\0\0\x1c\0\x51\x01\x0e\x10\x03\0\x01\0\0\0\x51\x01\x02\0\x0f\x10\x03\0\x01\0\0\0\x02\0\0\0\x10\x10\x03\0\x01\0\0\0\0\0\0\0\x11\x10\x03\0\x09\0\0\0\x36\x10\0\0\x12\x10\x03\0\x04\0\0\0\x48\x10\0\0\x13\x10\x03\0\x01\0\0\0\0\0\0\0\x14\x10\x03\0\x01\0\0\0\0\0\x01\0\x15\x10\x03\0\x02\0\0\0\x01\0\0\0\x16\x10\x03\0\x01\0\0\0\0\0\x70\x01\x17\x10\x03\0\x02\0\0\0\x70\x01\x40\0\x18\x10\x03\0\x02\0\0\0\x26\x01\x40\0\x1a\x10\x02\0\x20\0\0\0\xdc\x0f\0\0\x1b\x10\x04\0\x01\0\0\0\0\0\0\0\x1c\x10\x04\0\x01\0\0\0\0\0\0\0\x1d\x10\x04\0\x01\0\0\0\xe8\xb8\x03\0\x1e\x10\x04\0\x01\0\0\0\0\0\0\0\x1f\x10\x04\0\x01\0\0\0\0\0\0\0\x20\x10\x04\0\x01\0\0\0\0\0\0\0\x21\x10\x04\0\x01\0\0\0\xb0\x27\0\0\x22\x10\x04\0\x01\0\0\0\x20\x6e\x0f\x04\x23\x10\x0a\0\x01\0\0\0\x1c\x10\0\0\x24\x10\x03\0\x01\0\0\0\x36\0\0\0\x25\x10\x0a\0\x01\0\0\0\x28\x10\0\0\x26\x10\x03\0\x01\0\0\0\0\0\0\0\x27\x10\x03\0\x01\0\0\0\0\0\0\0\x28\x10\x03\0\x01\0\0\0\0\0\x64\x01\x29\x10\x03\0\x01\0\0\0\x02\0\0\x02\x2a\x10\x03\0\x01\0\0\0\0\x02\x18\0\x2b\x10\x03\0\x06\0\0\0\x54\x10\0\0\x2c\x10\x03\0\x02\0\0\0\x0a\0\0\0\x2d\x10\x03\0\x01\0\0\0\0\x08\0\0\x2e\x10\x04\0\x01\0\0\0\0\x0a\0\0\x2f\x10\x04\0\x01\0\0\0\x80\x07\0\0\x30\x10\x03\0\x01\0\0\0\x02\0\0\0\x31\x10\x04\0\x08\0\0\0\x74\x10\0\0\x33\x10\x04\0\xd0\x02\0\0\xa0\x10\0\0\x38\x10\x03\0\x01\0\0\0\0\0\0\0\x3b\x10\x03\0\x01\0\0\0\x21\x01\xbe\x01\x3c\x10\x03\0\x01\0\0\0\xbe\x01\0\0\x3d\x10\x0a\0\x01\0\0\0\xe4\x1b\0\0\x3e\x10\x0a\0\x01\0\0\0\xec\x1b\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '758 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2560);
|
||||
$this->assertEquals($entry->getText(), '2560');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1920);
|
||||
$this->assertEquals($entry->getText(), '1920');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal process');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto exposure');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto white balance');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41988); // DigitalZoomRatio
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 100,
|
||||
1 => 100
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '100/100');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Portrait');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41991); // GainControl
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41992); // Contrast
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41993); // Saturation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41994); // Sharpness
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 1);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 2);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/olympus-c50z-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
388
old.vendor/lsolesen/pel/test/imagetests/OlympusC765uzTest.php
Normal file
@@ -0,0 +1,388 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class OlympusC765uzTest extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/olympus-c765uz.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 11);
|
||||
|
||||
$entry = $ifd0->getEntry(270); // ImageDescription
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'OLYMPUS DIGITAL CAMERA ');
|
||||
$this->assertEquals($entry->getText(), 'OLYMPUS DIGITAL CAMERA ');
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'OLYMPUS CORPORATION');
|
||||
$this->assertEquals($entry->getText(), 'OLYMPUS CORPORATION');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'C765UZ');
|
||||
$this->assertEquals($entry->getText(), 'C765UZ');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'top - left');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(305); // Software
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'v777-76');
|
||||
$this->assertEquals($entry->getText(), 'v777-76');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1090073972);
|
||||
$this->assertEquals($entry->getText(), '2004:07:17 14:19:32');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'co-sited');
|
||||
|
||||
$entry = $ifd0->getEntry(50341); // PrintIM
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x50\x72\x69\x6e\x74\x49\x4d\0\x30\x32\x35\x30\0\0\x14\0\x01\0\x12\0\x12\0\x02\0\x01\0\0\0\x03\0\x88\0\0\0\x07\0\0\0\0\0\x08\0\0\0\0\0\x09\0\0\0\0\0\x0a\0\0\0\0\0\x0b\0\xd0\0\0\0\x0c\0\0\0\0\0\x0d\0\0\0\0\0\x0e\0\xe8\0\0\0\0\x01\x01\0\0\0\x01\x01\xff\0\0\0\x02\x01\x80\0\0\0\x03\x01\x80\0\0\0\x04\x01\x80\0\0\0\x05\x01\x80\0\0\0\x06\x01\x80\0\0\0\x07\x01\x80\x80\x80\0\x10\x01\x80\0\0\0\x09\x11\0\0\x10\x27\0\0\x0b\x0f\0\0\x10\x27\0\0\x97\x05\0\0\x10\x27\0\0\xb0\x08\0\0\x10\x27\0\0\x01\x1c\0\0\x10\x27\0\0\x5e\x02\0\0\x10\x27\0\0\x8b\0\0\0\x10\x27\0\0\xcb\x03\0\0\x10\x27\0\0\xe5\x1b\0\0\x10\x27\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x21\0\x9a\x82\x05\0\x01\0\0\0\xb8\x03\0\0\x9d\x82";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '(undefined)');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 32);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 10,
|
||||
1 => 2000
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/200 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 32,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/3.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34850); // ExposureProgram
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Creative program (biased toward depth of field)');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34855); // ISOSpeedRatings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 64);
|
||||
$this->assertEquals($entry->getText(), '64');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.2);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1090073972);
|
||||
$this->assertEquals($entry->getText(), '2004:07:17 14:19:32');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1090073972);
|
||||
$this->assertEquals($entry->getText(), '2004:07:17 14:19:32');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2/1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 34,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '34/10');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 5);
|
||||
$this->assertEquals($entry->getText(), 'Pattern');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37384); // LightSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Unknown');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 16);
|
||||
$this->assertEquals($entry->getText(), 'Flash did not fire, compulsory flash mode.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 109,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '10.9 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x4f\x4c\x59\x4d\x50\0\x01\0\x10\0\0\x02\x04\0\x03\0\0\0\xe0\x05\0\0\x01\x02\x03\0\x01\0\0\0\x01\0\0\0\x02\x02\x03\0\x01\0\0\0\x02\0\0\0\x03\x02\x03\0\x01\0\0\0\0\0\0\0\x04\x02\x05\0\x01\0\0\0\xec\x05\0\0\x05\x02\x05\0\x01\0\0\0\xf4\x05\0\0\x06\x02\x08\0\x06\0\0\0\xfc\x05\0\0\x07\x02\x02\0\x08\0\0\0\x08\x06\0\0\x08\x02\x02\0\x34\0\0\0\x10\x06\0\0\x09\x02\x07\0\x20\0\0\0\x4c\x06\0\0\0\x03\x03\0\x01\0\0\0\0\0\0\0\x01\x03\x03\0\x01\0\0\0\0\0\0\0\x02\x03\x03\0\x01\0\0\0\0\0\0\0\x03\x03\x03\0\x01\0\0\0\0\0\0\0\x04\x03\x03\0\x01\0\0\0\0\0\0\0\0\x0f\x07\0\xee\x01\0\0\x6c\x06\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\0\0\0\x64\0\0\0\xfa\x1b\0\0\xe8\x03\0\0\x90\xff\x0b\xff\xd4\xfe\xd6\xff\xbd\xff\xbd\xff\x53\x58\x37\x37\x37\0\0\0\x5b\x70\x69\x63\x74\x75\x72\x65\x49\x6e\x66\x6f\x5d\x20\x52\x65\x73\x6f\x6c\x75\x74\x69\x6f\x6e\x3d\x31\x20\x5b\x43\x61\x6d\x65\x72\x61\x20\x49\x6e\x66\x6f\x5d\x20\x54\x79\x70\x65\x3d\x53\x58\x37\x37\x37\0\0\0\0\0\0\0\0\0\x4f\x4c\x59\x4d\x50\x55\x53\x20\x44\x49\x47\x49\x54\x41\x4c\x20\x43\x41\x4d\x45\x52\x41\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x34\x02\x05\x02\x9f\0\0\0\0\xff\0\0\x02\x19\x61\x12\x31\0\0\x05\xe3\0\0\x1c\x20\0\0\x06\xfc\0\0\x1b\xf0\0\0\x1b\xf0\0\0\x07\x10\0\0\x16\x90\0\x64\0\xc7\0\x40\0\x1c\0\0\0\0\0\0\0\0\0\0\x2a\x92\0\0\0\0\x2a\x2e\x12\x03\x10\0\0\0\0\0\0\0\0\0\0\0\x13\x1a\0\0\x3c\0\x0f\x4a\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\x06\xfc\0\0\0\0\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x22\x11\x11\x11\x11\x01\xa4\x03\x7e\x03\xeb\x01\x7c\x02\x05\x02\x1b\x01\xa1\x02\0\x01\x02\xf0\x59\0\x01\x03\x52\0\x16\0\x0d\0\x16\0\x0d\0\x05\0\x0a\0\x01\0\0\0\0\0\x10\0\0\0\x14\0\x01\0\0\0\xc7\x01\x6f\x02\x17\x02\xc0\x03\x68\x01\x03\x01\x34\x02\x05\x02\x9f\0\0\x0c\x2f\x0d\xe1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x88\x88\x01\0\0\xed\x11\xda\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x40\x01\x1a\0\xb8\x02\x4e\0\x0e\x09\x17\x01\x44\x02\x73\x02\xde\x03\x10\x02\xd4\xd0\0\0\xed\x11\0\0\0\x01\x44\x01\xfc\x04\x53\x08\x48\x09\x17\x05\xc1\x02\x56\0\0\x0a\x84\x12\xcc\x19\x8d\x1b\x37\x16\x68\x0b\x90\x04\x38\0\0\x06\xff\x08\x92\x09\x29\x08\x3f\x06\x26\0\0\0\0\0\0\x1b\xa7\x1b\x24\x17\xe3\x12\xea\x0c\xd7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x77\x77\x77\x77\x13\x27\x13\x1f\x13\x1f\x13\x1f\x0d\x18\x05\0\xe1\x07\0\x07\0\0\x03\0\0\0\x0f\0\x69\0\x4f\x76\x59\x03\x03\0\x12\x24\x37\0\x15\x29\x14\x2a\x01\xfb\x01\x83\x01\xee\x02\x32\0\0\x01\x0d\0\x36\0\x6e\x02\x1b\x01\xa1\x12\x24\x14\x2a\x20\x52\0\x04\0\x0a\x04\x03\x6e\x5f\x01\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '840 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37510); // UserComment
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUserComment', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2288);
|
||||
$this->assertEquals($entry->getText(), '2288');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1712);
|
||||
$this->assertEquals($entry->getText(), '1712');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41729); // SceneType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01");
|
||||
$this->assertEquals($entry->getText(), 'Directly photographed');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal process');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto exposure');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto white balance');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41988); // DigitalZoomRatio
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 0,
|
||||
1 => 100
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '0/100');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Portrait');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41991); // GainControl
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41992); // Contrast
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41993); // Saturation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41994); // Sharpness
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 1);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 2);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 4);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/olympus-c765uz-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
429
old.vendor/lsolesen/pel/test/imagetests/PentaxIstDSTest.php
Normal file
61
old.vendor/lsolesen/pel/test/imagetests/README
Normal file
@@ -0,0 +1,61 @@
|
||||
README file for PEL Test Images.
|
||||
|
||||
Copyright (C) 2004, 2005, 2006 Martin Geisler.
|
||||
Licensed under the GNU GPL, see COPYING for details.
|
||||
|
||||
|
||||
PEL Test Images
|
||||
***************
|
||||
|
||||
The images contained in this directory are test images collected for
|
||||
use with PEL: PHP Exif Library. One can download PEL from:
|
||||
|
||||
http://github.com/lsolesen/pel/
|
||||
|
||||
All images except no-exif.jpg contain Exif information, and the
|
||||
corresponding PHP files contain SimpleTest (http://simpletest.sf.net/)
|
||||
unit tests.
|
||||
|
||||
To use those files with PEL, first place this directory (the
|
||||
image-tests directory) under the test directory in an unpacked PEL
|
||||
source tree. Install SimpleTest using the instructions found in the
|
||||
README file in the test directory.
|
||||
|
||||
Now run the run-tests.php script in the test directory. It should
|
||||
automatically pickup the new tests.
|
||||
|
||||
The images can be used by anybody, but may only be redistributed under
|
||||
the GNU GPL. See the file COPYING for the details.
|
||||
|
||||
|
||||
Contributing Test Images
|
||||
************************
|
||||
|
||||
If you own a camera model from which there are no test image, then
|
||||
please contribute one. The image should
|
||||
|
||||
* contain as much interesting Exif tags as possible. The camera
|
||||
should therefore be set to a manual mode, and the settings should be
|
||||
changed from their defaults,
|
||||
|
||||
* have as small a file size as possible, so use a resolution of
|
||||
640x480 or less, if possible. Also, use the poorest image quality
|
||||
(the best compression) to reduce the file size.
|
||||
|
||||
* come from the camera unaltered. Do not resize the image using an
|
||||
image manipulation program, for then it is this program that will be
|
||||
tested, not the camera that took the image,
|
||||
|
||||
* be of something which wont protest to be widely published on the
|
||||
net. Things like a flower, a mountain, or a cat springs to mind,
|
||||
whereas pictures from a private party are no good,
|
||||
|
||||
* be licensed under the GNU GPL as the rest of PEL Test Images, so
|
||||
that it can be redistributed with it.
|
||||
|
||||
Submit your test image(s) by forking the repository found at
|
||||
|
||||
http://github.com/lsolesen/pel/
|
||||
|
||||
All image contributers will be given full credit in the AUTHORS file
|
||||
distributed with PEL.
|
||||
369
old.vendor/lsolesen/pel/test/imagetests/SonyDscV1Test.php
Normal file
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PEL: PHP Exif Library. A library with support for reading and
|
||||
* writing all Exif headers in JPEG and TIFF images using PHP.
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Martin Geisler.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program in the file COPYING; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
namespace Pel\Test\imagetests;
|
||||
|
||||
use lsolesen\pel\Pel;
|
||||
use lsolesen\pel\PelJpeg;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SonyDscV1Test extends TestCase
|
||||
{
|
||||
|
||||
public function testRead()
|
||||
{
|
||||
Pel::clearExceptions();
|
||||
Pel::setStrictParsing(false);
|
||||
$jpeg = new PelJpeg(dirname(__FILE__) . '/sony-dsc-v1.jpg');
|
||||
|
||||
$exif = $jpeg->getExif();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelExif', $exif);
|
||||
|
||||
$tiff = $exif->getTiff();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelTiff', $tiff);
|
||||
|
||||
/* The first IFD. */
|
||||
$ifd0 = $tiff->getIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0);
|
||||
|
||||
/* Start of IDF $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getEntries()), 10);
|
||||
|
||||
$entry = $ifd0->getEntry(270); // ImageDescription
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), ' ');
|
||||
$this->assertEquals($entry->getText(), ' ');
|
||||
|
||||
$entry = $ifd0->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'SONY');
|
||||
$this->assertEquals($entry->getText(), 'SONY');
|
||||
|
||||
$entry = $ifd0->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'DSC-V1');
|
||||
$this->assertEquals($entry->getText(), 'DSC-V1');
|
||||
|
||||
$entry = $ifd0->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'right - top');
|
||||
|
||||
$entry = $ifd0->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd0->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd0->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1089482993);
|
||||
$this->assertEquals($entry->getText(), '2004:07:10 18:09:53');
|
||||
|
||||
$entry = $ifd0->getEntry(531); // YCbCrPositioning
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'co-sited');
|
||||
|
||||
$entry = $ifd0->getEntry(50341); // PrintIM
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x50\x72\x69\x6e\x74\x49\x4d\0\x30\x32\x35\x30\0\0\x02\0\x02\0\x01\0\0\0\x01\x01\0\0\0\0");
|
||||
$this->assertEquals($entry->getText(), '(undefined)');
|
||||
|
||||
/* Sub IFDs of $ifd0. */
|
||||
$this->assertEquals(count($ifd0->getSubIfds()), 1);
|
||||
$ifd0_0 = $ifd0->getSubIfd(2); // IFD Exif
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getEntries()), 26);
|
||||
|
||||
$entry = $ifd0_0->getEntry(33434); // ExposureTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 10,
|
||||
1 => 600
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '1/60 sec.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(33437); // FNumber
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 32,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), 'f/3.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34850); // ExposureProgram
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Normal program');
|
||||
|
||||
$entry = $ifd0_0->getEntry(34855); // ISOSpeedRatings
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 100);
|
||||
$this->assertEquals($entry->getText(), '100');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36864); // ExifVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2.2);
|
||||
$this->assertEquals($entry->getText(), 'Exif Version 2.2');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36867); // DateTimeOriginal
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1089482993);
|
||||
$this->assertEquals($entry->getText(), '2004:07:10 18:09:53');
|
||||
|
||||
$entry = $ifd0_0->getEntry(36868); // DateTimeDigitized
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1089482993);
|
||||
$this->assertEquals($entry->getText(), '2004:07:10 18:09:53');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37121); // ComponentsConfiguration
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01\x02\x03\0");
|
||||
$this->assertEquals($entry->getText(), 'Y Cb Cr -');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37122); // CompressedBitsPerPixel
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 2,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '2/1');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37380); // ExposureBiasValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntrySRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 7,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '+0.7');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37381); // MaxApertureValue
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 48,
|
||||
1 => 16
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '48/16');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37383); // MeteringMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Center-Weighted Average');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37384); // LightSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Unknown');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37385); // Flash
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 31);
|
||||
$this->assertEquals($entry->getText(), 'Flash fired, auto mode, return light detected.');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37386); // FocalLength
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 139,
|
||||
1 => 10
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '13.9 mm');
|
||||
|
||||
$entry = $ifd0_0->getEntry(37500); // MakerNote
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$expected = "\x53\x4f\x4e\x59\x20\x44\x53\x43\x20\0\0\0\x0c\0\x01\x90\x07\0\x94\0\0\0\x40\x03\0\0\x02\x90\x07\0\xc8\0\0\0\xd4\x03\0\0\x03\x90\x07\0\xc8\0\0\0\x9c\x04\0\0\x04\x90\x07\0\x1a\0\0\0\x64\x05\0\0\x05\x90\x07\0\x78\0\0\0\x7e\x05\0\0\x06\x90\x07\0\xfc\0\0\0\xf6\x05\0\0\x07\x90\x07\0\xc8\0\0\0\xf2\x06\0\0\x08\x90\x07\0\xc8\0\0\0\xba\x07\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xdf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\0\0\0\x0c\0\0\0\x05\0\x6e\x7e\xa0\0\xe4\x89\x2c\0\xe7\x8f\0\0\0\0\x0c\0\0\0\0\0\0\0\x0c\0\x01\xe7\x41\xff\0\0\0\0\0\x08\x07\x02\x09\xfe\0\x60\x1f\x08\xdf\x5e\xf0\xff\x4a\xfe\0\0\0\0\x4a\x30\0\x88\x1f\x05\x4a\x30\x4a\x88\0\x70\0\0\x70\0\0\x01\xb8\0\x5e\0\x81\0\0\x56\x0d\0\0\0\x63\0\0\xd8\xc4\0\0\xd2\x90\x88\x1f\xbe\0\x70\0\0\xc8\0\xbe\x5e\0\xd8\x6f\0\0\x40\x50\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\x04\0\x1b\0\0\0\x07\0\0\x01\xb8\x08\0\x8a\xb7\0\x74\x91\xf0\0\x8c\x75\x3d\0\0\0\xd8\0\0\0\0\0\0\0\0\0\0\0\0\x05\xc4\0\0\xd3\0\xc3\x74\xd7\x93\xd8\x67\x05\xc4\xd7\x22\x30\x63\0\0\0\0\xd7\xa7\xbe\x21\0\0\0\0\0\0\0\0\0\0\x01\x14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x0e\x08\xe3\0\x7d\0\x28\x8a\x0e\0\x5e\0\0\xa8\0\xbe\xc0\xbe\xc0\xd7\x93\x40\0\0\0\xdc\xdc\x73\x46\0\x92\0\xb7\0\x23\0\x23\0\x47\0\x82\0\x06\0\x55\xef\x10\x24\x31\xef\xc3\x79\x73\xef\x10\x79\x8a\x79\x05\xc4\xef\x5b\xc5\x18\xc5\x18\x7d\xa5\x88\xb7\xcf\0\0\x01\x69\0\0\0\0\0\0\0\0\xff\0\0\xf1\0\x07\0\x47\xff\0\x01\x15\0\x6a\0\x20\x23\0\x5e\0\0\0\x56\0\x08\xdd\x01\xc5\x01\0\x01\0\x04\x80\x1b\xf2\x45\xdd\x38\x54\0\x69\x24\xdc\x0c\x63\xf0\xde\xec\x23\x28\x47\xf0\xa8\x92\x45\xef\x21\xc5\x49\x58\x2f\0\xc3\x46\xfe\x59\x5a\x9f\xfe\0\x07\xf3\x52\xa0\x6e\x51\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\x20\x08\x1b\0\x01\xdc\xdc\xbc\x5f\x10\0\0\x08\xec\x08\xe7\x08\x04\x08\x51\0\xdc\0\xe3\0\xe3\0\xc2\0\0\0\0\0\0\0\0\x01\x01\0\0\0\0\0\x7d\0\0\0\0\0\x7b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\0\x01\0\0\0\0\0\x01\0\x01\0\x08\0\x01\0\x01\xe5\x91\x51\x08\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\0\xff\0\0\0\0\0\0\0\0\xb3\xe5\0\0\xff\xff\0\0\xcd\x95\x51\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x7d\0\x40\0\x1b\0\0\0\x01\xd8\x2b\xd8\x47\x5e\xa7\xbb\x9e\x0e\x8b\x20\x08\xa0\xfd\xd8\xf4\x5e\x2b\x56\x69\x88\xe8\xd8\xaa\xb6\x60\x6a\x98\x0e\x53\x56\x8e\x56\x8d\x05\xe1\xd8\x5d\x20\xcc\xd3\x58\x5e\xb6\x04\xb7\xe7\xe9\xcd\x57\x7d\x2c\xd7\x24\x5d\xbc\x5e\xd3\x04\xdc\xd8\x8f\xea\x4f\x7d\x6e\x30\x28\xd3\x4b\x7d\xf7\xe7\xf8\x7d\x09\x8a\x26\x7d\xc4\x88\x24\xa0\x9e\x40\x94\x7d\xf1\x7d\x95\x5e\x46\x40\xd3\x70\x44\xbe\xfb\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x08\0\0\0\0\0\x1b\0\x1b\0\0\0\x7d\0\x5e\0\0\0\0\0\x08\0\x40\0\0\0\xd8\0\xe7\0\0\0\0\0\x08\0\x40\0\0\0\x0e\0\x0e\0\0\0\0\0\x08\0\x7d\0\0\0\xe7\0\x08\0\x7d\0\x1b\0\0\0\x01\0\0\0\xd8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x40\x43\xd8\xe0\x5e\xd1\x04\xf7\x8a\xde\x30\xf4\x20\x39\x05\x45\x05\xce\xb6\x31\x88\xbf\x30\x24\x30\x77\x30\xb7\x88\x65\0\xa3\x7d\xdd\xd8\xd6\x0e\x43\xea\x11\x69\x6c\x81\xb9\xec\x45\x28\x13\xb6\xe6\x20\xdc\xbe\x5b\x81\x3e\x0c\xc3\xec\x9e\x6c\x35\0\0\0\0\x08\x4a\x08\x22\x1b\xe2\x40\x9e\x5e\x4b\xb6\x8b\x05\xa0\xd8\x41\x5e\xa9\x56\xdd\x8a\x43\x69\x80\x69\x5b\x70\xe0\xea\x88\0\xa3\x08\x8d\x1b\xc4\x1b\xa8\x7d\x57\x56\xa7\x69\x8c\x88\xe6\x69\x94\x56\xa9\x8a\x08\xb6\xba\x69\x23\x69\xba\x88\x94\xbe\x81\0\0\0\0\x40\x43\x7d\x40\x7d\x54\xd8\x54\xe7\xea\x70\xc7\x05\x07\x5e\xe1\x0e\xa8\x56\xa4\x05\x80\x70\xc7\x70\xc7\x05\x80\x56\x0d\0\xa3\x30\x63\xbe\xd8\xbe\x5b\xbe\x9e\xbe\x21\xd7\x96\xd7\x86\xd7\x22\xbe\x21\xd7\xb6\xd7\xef\xd7\x74\xd7\xd4\xd7\xb3\xd7\xa7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
$this->assertEquals($entry->getValue(), $expected);
|
||||
$this->assertEquals($entry->getText(), '1504 bytes unknown MakerNote data');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40960); // FlashPixVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'FlashPix Version 1.0');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40961); // ColorSpace
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'sRGB');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40962); // PixelXDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 640);
|
||||
$this->assertEquals($entry->getText(), '640');
|
||||
|
||||
$entry = $ifd0_0->getEntry(40963); // PixelYDimension
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryLong', $entry);
|
||||
$this->assertEquals($entry->getValue(), 480);
|
||||
$this->assertEquals($entry->getText(), '480');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41728); // FileSource
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x03");
|
||||
$this->assertEquals($entry->getText(), 'DSC');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41729); // SceneType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryUndefined', $entry);
|
||||
$this->assertEquals($entry->getValue(), "\x01");
|
||||
$this->assertEquals($entry->getText(), 'Directly photographed');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41985); // CustomRendered
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Normal process');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41986); // ExposureMode
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Manual exposure');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41987); // WhiteBalance
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Auto white balance');
|
||||
|
||||
$entry = $ifd0_0->getEntry(41990); // SceneCaptureType
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 0);
|
||||
$this->assertEquals($entry->getText(), 'Standard');
|
||||
|
||||
/* Sub IFDs of $ifd0_0. */
|
||||
$this->assertEquals(count($ifd0_0->getSubIfds()), 1);
|
||||
$ifd0_0_0 = $ifd0_0->getSubIfd(4); // IFD Interoperability
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd0_0_0);
|
||||
|
||||
/* Start of IDF $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getEntries()), 2);
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(1); // InteroperabilityIndex
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'R98');
|
||||
$this->assertEquals($entry->getText(), 'R98');
|
||||
|
||||
$entry = $ifd0_0_0->getEntry(2); // InteroperabilityVersion
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryVersion', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1);
|
||||
$this->assertEquals($entry->getText(), 'Interoperability Version 1.0');
|
||||
|
||||
/* Sub IFDs of $ifd0_0_0. */
|
||||
$this->assertEquals(count($ifd0_0_0->getSubIfds()), 0);
|
||||
|
||||
$this->assertEquals($ifd0_0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_0_1 = $ifd0_0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_0_1);
|
||||
/* End of IFD $ifd0_0_0. */
|
||||
|
||||
$this->assertEquals($ifd0_0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd0_1 = $ifd0_0->getNextIfd();
|
||||
$this->assertNull($ifd0_1);
|
||||
/* End of IFD $ifd0_0. */
|
||||
|
||||
$this->assertEquals($ifd0->getThumbnailData(), '');
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd1 = $ifd0->getNextIfd();
|
||||
$this->assertInstanceOf('lsolesen\pel\PelIfd', $ifd1);
|
||||
/* End of IFD $ifd0. */
|
||||
|
||||
/* Start of IDF $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getEntries()), 8);
|
||||
|
||||
$entry = $ifd1->getEntry(259); // Compression
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'JPEG compression');
|
||||
|
||||
$entry = $ifd1->getEntry(271); // Make
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'SONY');
|
||||
$this->assertEquals($entry->getText(), 'SONY');
|
||||
|
||||
$entry = $ifd1->getEntry(272); // Model
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryAscii', $entry);
|
||||
$this->assertEquals($entry->getValue(), 'DSC-V1');
|
||||
$this->assertEquals($entry->getText(), 'DSC-V1');
|
||||
|
||||
$entry = $ifd1->getEntry(274); // Orientation
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 6);
|
||||
$this->assertEquals($entry->getText(), 'right - top');
|
||||
|
||||
$entry = $ifd1->getEntry(282); // XResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(283); // YResolution
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryRational', $entry);
|
||||
$this->assertEquals($entry->getValue(), [
|
||||
0 => 72,
|
||||
1 => 1
|
||||
]);
|
||||
$this->assertEquals($entry->getText(), '72/1');
|
||||
|
||||
$entry = $ifd1->getEntry(296); // ResolutionUnit
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryShort', $entry);
|
||||
$this->assertEquals($entry->getValue(), 2);
|
||||
$this->assertEquals($entry->getText(), 'Inch');
|
||||
|
||||
$entry = $ifd1->getEntry(306); // DateTime
|
||||
$this->assertInstanceOf('lsolesen\pel\PelEntryTime', $entry);
|
||||
$this->assertEquals($entry->getValue(), 1089482993);
|
||||
$this->assertEquals($entry->getText(), '2004:07:10 18:09:53');
|
||||
|
||||
/* Sub IFDs of $ifd1. */
|
||||
$this->assertEquals(count($ifd1->getSubIfds()), 0);
|
||||
|
||||
$thumb_data = file_get_contents(dirname(__FILE__) . '/sony-dsc-v1-thumb.jpg');
|
||||
$this->assertEquals($ifd1->getThumbnailData(), $thumb_data);
|
||||
|
||||
/* Next IFD. */
|
||||
$ifd2 = $ifd1->getNextIfd();
|
||||
$this->assertNull($ifd2);
|
||||
/* End of IFD $ifd1. */
|
||||
|
||||
$this->assertTrue(count(Pel::getExceptions()) == 0);
|
||||
}
|
||||
}
|
||||
BIN
old.vendor/lsolesen/pel/test/imagetests/canon-eos-650d-thumb.jpg
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/canon-eos-650d.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/canon-ixus-ii-thumb.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/canon-ixus-ii.jpg
Normal file
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/canon-powershot-s60.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/fujifilm_x_a5.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/leica-d-lux-thumb.jpg
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/leica-d-lux.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/nikon-coolscan-iv.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/nikon-e5000-thumb.jpg
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/nikon-e5000.jpg
Normal file
|
After Width: | Height: | Size: 310 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/nikon-e950-thumb.jpg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/nikon-e950.jpg
Normal file
|
After Width: | Height: | Size: 343 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/olympus-c5050z-thumb.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/olympus-c5050z.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/olympus-c50z-thumb.jpg
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/olympus-c50z.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/olympus-c765uz-thumb.jpg
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/olympus-c765uz.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/pentax-istDS-thumb.jpg
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/pentax-istDS.jpg
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/sony-dsc-v1-thumb.jpg
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
old.vendor/lsolesen/pel/test/imagetests/sony-dsc-v1.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |