While I'm trying to view a .ts.mp4 file generated by my phone, Piwigo errors out due to running out of memory. Judging from the stack trace, it seems like it tried to count PDF pages and ran out of memory because it tried to allocate memory for the size of the whole file. Shorter videos from the same phone work fine in Piwigo. I don't have a setup at hand to try this out with Piwigo 14.x, but I do think even large videos used to work fine.
I would expect Piwigo to be able to view videos that are larger than the largest memory allocation allowed for the PHP interpreter. My guess is that this PDF functionality is erroneously triggered for this and maybe other files too.
I'm on Piwigo 15.0.0RC1 running on custom Docker image.
Environment details, pardon my Finnish 😎
[Piwigo](https://piwigo.org/) 15.0.0RC1 [Tarkista päivitykset](http://redacted/admin.php?page=maintenance&action=check_upgrade&pwg_token=redacted&tab=env)
Asennettu 4 Lokakuu 2016, 8 vuodet 1 päivä sitten
Käyttöjärjestelmä: Linux
PHP: 8.2.20 ([Näytä tiedot](http://redacted/admin.php?page=maintenance&action=phpinfo&pwg_token=redacted)) [2024-10-06 18:25:41]
MySQL: 11.2.2-MariaDB-1:11.2.2+maria~ubu2204 [2024-10-06 18:25:41]
Grafiikkakirjasto: ImageMagick ImageMagick 6.9.11-60
Välimuistin koko 29991.25 Mo laskettu 6 kuukausia sitten Virkistä
<!-- github-sync-id:2568813071 -->
While I'm trying to view a .ts.mp4 file generated by my phone, Piwigo errors out due to running out of memory. Judging from the stack trace, it seems like it tried to count PDF pages and ran out of memory because it tried to allocate memory for the size of the whole file. Shorter videos from the same phone work fine in Piwigo. I don't have a setup at hand to try this out with Piwigo 14.x, but I do think even large videos used to work fine.
I would expect Piwigo to be able to view videos that are larger than the largest memory allocation allowed for the PHP interpreter. My guess is that this PDF functionality is erroneously triggered for this and maybe other files too.
I'm on Piwigo 15.0.0RC1 running on custom Docker image.

Environment details, pardon my Finnish :sunglasses:
```
[Piwigo](https://piwigo.org/) 15.0.0RC1 [Tarkista päivitykset](http://redacted/admin.php?page=maintenance&action=check_upgrade&pwg_token=redacted&tab=env)
Asennettu 4 Lokakuu 2016, 8 vuodet 1 päivä sitten
Käyttöjärjestelmä: Linux
PHP: 8.2.20 ([Näytä tiedot](http://redacted/admin.php?page=maintenance&action=phpinfo&pwg_token=redacted)) [2024-10-06 18:25:41]
MySQL: 11.2.2-MariaDB-1:11.2.2+maria~ubu2204 [2024-10-06 18:25:41]
Grafiikkakirjasto: ImageMagick ImageMagick 6.9.11-60
Välimuistin koko 29991.25 Mo laskettu 6 kuukausia sitten Virkistä
<!-- github-sync-id:2568813071 -->
I made an experimental fix for this in a PR, but I don't know if it follows best practices. At least it addresses the issue, but I will not be offended if you will fix it some other way.
I made an experimental fix for this in a PR, but I don't know if it follows best practices. At least it addresses the issue, but I will not be offended if you will fix it some other way.
<!-- github-comment-id:2396131843 -->
Ah, I think this has appeared in the implementation of #2170. I think picture.php as of now greps through the original file even though there's a cached thumbnail, trying to count PDF page tags. I think this has potential to cause performance regression even with files that are all under the maximum memory limit.
Ah, I think this has appeared in the implementation of #2170. I think picture.php as of now greps through the original file even though there's a cached thumbnail, trying to count PDF page tags. I think this has potential to cause performance regression even with files that are all under the maximum memory limit.
<!-- github-comment-id:2396816763 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
While I'm trying to view a .ts.mp4 file generated by my phone, Piwigo errors out due to running out of memory. Judging from the stack trace, it seems like it tried to count PDF pages and ran out of memory because it tried to allocate memory for the size of the whole file. Shorter videos from the same phone work fine in Piwigo. I don't have a setup at hand to try this out with Piwigo 14.x, but I do think even large videos used to work fine.
I would expect Piwigo to be able to view videos that are larger than the largest memory allocation allowed for the PHP interpreter. My guess is that this PDF functionality is erroneously triggered for this and maybe other files too.
I'm on Piwigo 15.0.0RC1 running on custom Docker image.
Environment details, pardon my Finnish 😎
I made an experimental fix for this in a PR, but I don't know if it follows best practices. At least it addresses the issue, but I will not be offended if you will fix it some other way.
Ah, I think this has appeared in the implementation of #2170. I think picture.php as of now greps through the original file even though there's a cached thumbnail, trying to count PDF page tags. I think this has potential to cause performance regression even with files that are all under the maximum memory limit.