Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge upstream Feb 11, 2024 #43

Merged
merged 8 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
# Remove the comment to the lines below during development, to let
# re-compile the specification PHP file from the YAML files.
# php bin/fileeye-mediaprobe compile
# php bin/fileeye-mediaprobe dump tests/media-samples tests/media-dumps

- name: Image file dumps
continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ All in just four lines of code:

```php5
<?php
use FileEye\MediaProbe\Image;
use FileEye\MediaProbe\Media;

$image = Image::loadFromFile($argv[1]);
$image = Media::parseFromFile($argv[1]);
$entry = $image->getElement("tag[@name='ImageDescription']/entry");
$entry->setDataElement(['Edited by MediaProbe']);
$image->saveToFile($argv[1]);
Expand Down
2 changes: 1 addition & 1 deletion SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ An IFD is fully described by a single YAML file. The file name should convention

```
type: 'IFD0'
class: FileEye\MediaProbe\Block\Exif\Ifd
class: FileEye\MediaProbe\Block\Tiff\Ifd
alias:
- '0'
- 'Main'
Expand Down
12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
"symfony/process": "^6 | ^7",
"symfony/var-dumper": "^6 | ^7",
"symfony/yaml": "^6 | ^7",
"bramus/monolog-colored-line-formatter": "^3"
"bramus/monolog-colored-line-formatter": "^3",
"phpstan/phpstan": "^1.10",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1"
},
"autoload": {
"psr-4": {
Expand All @@ -40,5 +43,10 @@
"FileEye\\MediaProbe\\Test\\": "tests/"
}
},
"bin": ["bin/fileeye-mediaprobe"]
"bin": ["bin/fileeye-mediaprobe"],
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
6 changes: 3 additions & 3 deletions examples/dump-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use FileEye\MediaProbe\Media;
use FileEye\MediaProbe\Data\DataWindow;
use FileEye\MediaProbe\Utility\ConvertBytes;
use FileEye\MediaProbe\Block\Jpeg;
use FileEye\MediaProbe\Block\Tiff;
use FileEye\MediaProbe\Block\Jpeg\Jpeg;
use FileEye\MediaProbe\Block\Tiff\Tiff;
use FileEye\MediaProbe\Utility\DumpLogFormatter;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
Expand Down Expand Up @@ -135,7 +135,7 @@ function FileSizeConvert($bytes)
try {
/* Load data from file */
$baseline_memory = FileSizeConvert(memory_get_usage());
$media = Media::loadFromFile($file, $logger, $fail_on_error);
$media = Media::parseFromFile($file, $logger, $fail_on_error);
$max_memory = FileSizeConvert(memory_get_peak_usage());
$curr_memory = FileSizeConvert(memory_get_usage());
if ($media === null) {
Expand Down
7 changes: 0 additions & 7 deletions specs/Exif/Exif.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Apple/Main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Apple
title: 'Apple Maker Notes'
class: FileEye\MediaProbe\Block\Exif\Vendor\Apple\MakerNote
DOMNode: makerNote
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Apple
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Apple/RunTime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: AppleRuntime
title: 'Apple Runtime'
class: FileEye\MediaProbe\Block\Exif\Vendor\Apple\RunTime
DOMNode: plist
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Apple
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/AFConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class: FileEye\MediaProbe\Block\Index
DOMNode: index
format: Long
hasIndexSize: true
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/AFInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon AF Info'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\AFInfoIndex
DOMNode: index
format: Short
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/AFInfo2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\AFInfoIndex
DOMNode: index
format: Short
hasIndexSize: true
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/AFMicroAdj.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class: FileEye\MediaProbe\Block\Map
DOMNode: map
format: Long
hasIndexSize: true
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/Ambience.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class: FileEye\MediaProbe\Block\Map
DOMNode: map
format: Long
hasIndexSize: true
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/AspectInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon AspectInfo'
class: FileEye\MediaProbe\Block\Index
DOMNode: index
format: Long
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CNTH.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: CanonCNTH
title: 'Canon CNTH'
class: FileEye\MediaProbe\Block\Index
DOMNode: index
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CTMD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: CanonCTMD
title: 'Canon CTMD'
class: FileEye\MediaProbe\Block\Index
DOMNode: index
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo1000D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo1000D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo1D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo1D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo1DX.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo1DX'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo1DmkII.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo1DmkII'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo1DmkIII.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo1DmkIII'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo1DmkIIN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo1DmkIIN'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo1DmkIV.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo1DmkIV'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo40D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo40D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo450D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo450D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo500D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo500D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo50D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo50D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo550D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo550D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo5D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo5D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo5DmkII.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo5DmkII'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo5DmkIII.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo5DmkIII'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo600D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo600D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo60D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo60D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo650D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo650D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo6D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo6D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo70D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo70D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo750D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo750D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo7D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo7D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfo80D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfo80D'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Byte
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfoPowerShot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfoPowerShot'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Long
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
2 changes: 1 addition & 1 deletion specs/ExifMakerNotes/Canon/CameraInfoPowerShot2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Canon CameraInfoPowerShot2'
class: FileEye\MediaProbe\Block\Exif\Vendor\Canon\CameraInfoMap
DOMNode: map
format: Long
defaultItemCollection: Tag
defaultItemCollection: Tiff\Tag
compiler:
exiftool:
g1: Canon
Expand Down
Loading
Loading