Skip to content

Commit 1595953

Browse files
committed
Update the webp-exif library
1 parent 9de79bd commit 1595953

5 files changed

Lines changed: 42 additions & 36 deletions

File tree

wcfsetup/install/files/lib/system/api/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"symfony/polyfill-php84": "^1.33",
3737
"symfony/polyfill-php85": "^1.33",
3838
"willdurand/negotiation": "^3.1",
39-
"woltlab/webp-exif": "^0.1.3"
39+
"woltlab/webp-exif": "^0.1.4"
4040
},
4141
"replace": {
4242
"paragonie/random_compat": "*",

wcfsetup/install/files/lib/system/api/composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcfsetup/install/files/lib/system/api/composer/installed.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,17 +3618,17 @@
36183618
},
36193619
{
36203620
"name": "woltlab/webp-exif",
3621-
"version": "v0.1.3",
3622-
"version_normalized": "0.1.3.0",
3621+
"version": "v0.1.4",
3622+
"version_normalized": "0.1.4.0",
36233623
"source": {
36243624
"type": "git",
36253625
"url": "https://github.com/WoltLab/webp-exif.git",
3626-
"reference": "f6783274c07041f6cc88783d830d0230c9e14720"
3626+
"reference": "c2692d7ba8545839f9a681e9c9b5cfb169c64740"
36273627
},
36283628
"dist": {
36293629
"type": "zip",
3630-
"url": "https://api.github.com/repos/WoltLab/webp-exif/zipball/f6783274c07041f6cc88783d830d0230c9e14720",
3631-
"reference": "f6783274c07041f6cc88783d830d0230c9e14720",
3630+
"url": "https://api.github.com/repos/WoltLab/webp-exif/zipball/c2692d7ba8545839f9a681e9c9b5cfb169c64740",
3631+
"reference": "c2692d7ba8545839f9a681e9c9b5cfb169c64740",
36323632
"shasum": ""
36333633
},
36343634
"require": {
@@ -3646,7 +3646,7 @@
36463646
"phpunit/php-code-coverage": "^12.0",
36473647
"phpunit/phpunit": "^12.2"
36483648
},
3649-
"time": "2026-03-09T22:42:18+00:00",
3649+
"time": "2026-06-04T19:30:22+00:00",
36503650
"type": "library",
36513651
"installation-source": "dist",
36523652
"autoload": {
@@ -3665,11 +3665,11 @@
36653665
],
36663666
"support": {
36673667
"issues": "https://github.com/WoltLab/webp-exif/issues",
3668-
"source": "https://github.com/WoltLab/webp-exif/tree/v0.1.3"
3668+
"source": "https://github.com/WoltLab/webp-exif/tree/v0.1.4"
36693669
},
36703670
"install-path": "../woltlab/webp-exif"
36713671
}
36723672
],
3673-
"dev": false,
3673+
"dev": true,
36743674
"dev-package-names": []
36753675
}

wcfsetup/install/files/lib/system/api/composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
'name' => '__root__',
44
'pretty_version' => '6.2.x-dev',
55
'version' => '6.2.9999999.9999999-dev',
6-
'reference' => '2df23754c8cda64ac1295a33b6cac8eba367738b',
6+
'reference' => '9de79bd52220783e0df99ea908d694d8ce8f9948',
77
'type' => 'project',
88
'install_path' => __DIR__ . '/../',
99
'aliases' => array(),
10-
'dev' => false,
10+
'dev' => true,
1111
),
1212
'versions' => array(
1313
'__root__' => array(
1414
'pretty_version' => '6.2.x-dev',
1515
'version' => '6.2.9999999.9999999-dev',
16-
'reference' => '2df23754c8cda64ac1295a33b6cac8eba367738b',
16+
'reference' => '9de79bd52220783e0df99ea908d694d8ce8f9948',
1717
'type' => 'project',
1818
'install_path' => __DIR__ . '/../',
1919
'aliases' => array(),
@@ -532,9 +532,9 @@
532532
'dev_requirement' => false,
533533
),
534534
'woltlab/webp-exif' => array(
535-
'pretty_version' => 'v0.1.3',
536-
'version' => '0.1.3.0',
537-
'reference' => 'f6783274c07041f6cc88783d830d0230c9e14720',
535+
'pretty_version' => 'v0.1.4',
536+
'version' => '0.1.4.0',
537+
'reference' => 'c2692d7ba8545839f9a681e9c9b5cfb169c64740',
538538
'type' => 'library',
539539
'install_path' => __DIR__ . '/../woltlab/webp-exif',
540540
'aliases' => array(),

wcfsetup/install/files/lib/system/api/woltlab/webp-exif/src/Chunk/Exif.php

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,27 @@ public function getParsedExif(bool $sectionsAsArrays = true): ?array
5555
// the two bytes for the length itself.
5656
$byteLength = \pack("n", 2 + 6 + \strlen($bytes));
5757

58-
// We must suppress warnings here to gracefully recover from bad EXIF data.
59-
$exif = @\exif_read_data(
60-
\sprintf(
61-
"data://image/jpeg;base64,%s",
62-
\base64_encode(
63-
$soiTag .
64-
$app1Tag .
65-
$byteLength .
66-
$exifHeader .
67-
$bytes .
68-
$jpegBody
69-
),
70-
),
71-
as_arrays: $sectionsAsArrays,
58+
// An in-memory stream is used instead of a `data://` URL because the
59+
// latter requires `allow_url_fopen` to be enabled.
60+
$stream = \fopen('php://memory', 'r+');
61+
\assert($stream !== false);
62+
\fwrite(
63+
$stream,
64+
$soiTag .
65+
$app1Tag .
66+
$byteLength .
67+
$exifHeader .
68+
$bytes .
69+
$jpegBody,
7270
);
71+
\rewind($stream);
72+
73+
try {
74+
// We must suppress warnings here to gracefully recover from bad EXIF data.
75+
$exif = @\exif_read_data($stream, as_arrays: $sectionsAsArrays);
76+
} finally {
77+
\fclose($stream);
78+
}
7379

7480
// Parsing the EXIF data can fail when processing malformed binary blobs
7581
// and is non-recoverable.

0 commit comments

Comments
 (0)