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

Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in getid3_jpg->CastAsAppropriate() #407

Closed
avdeijk opened this issue Dec 13, 2022 · 6 comments

Comments

@avdeijk
Copy link

avdeijk commented Dec 13, 2022

Describe the bug
Using james-heinrich/getid3 on PHP8.1 triggers the following deprecation notice:

Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in getid3_jpg->CastAsAppropriate() (line 194 of [..]/vendor/james-heinrich/getid3/getid3/module.graphic.jpg.php)

This happens only for some images where the exif value for a certain keys has a value of null.

To Reproduce
Use PHP8.1

Expected behavior
Using PHP8.1 does not trigger a deprecation notice when the value for a certain exif key is null.

@avdeijk
Copy link
Author

avdeijk commented Dec 13, 2022

See pull request #406

@StudioMaX
Copy link
Collaborator

Could you please attach any such image? I tested on my collection even on PHP 8.2, didn't seen deprecations in this part.

@avdeijk
Copy link
Author

avdeijk commented Dec 15, 2022

IMG_6270

Here is an image on which I got a deprecation notice.

@JamesHeinrich
Copy link
Owner

I tried this image and didn't see any problems on PHP 7.4.1 or 8.0.11

@StudioMaX
Copy link
Collaborator

This warning appeared since PHP 8.1.
https://3v4l.org/WhV7V
изображение

JamesHeinrich added a commit that referenced this issue Jan 13, 2023
@JamesHeinrich
Copy link
Owner

I finally got a PHP 8.2 test environment set up. Once I had that it was easy to find and fix the problem(s).
a61d9c5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants