[PR #243] [CLOSED] Feature/movie and pdf support #958

Closed
opened 2026-03-15 15:44:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/flyimg/flyimg/pull/243
Author: @louisl
Created: 1/31/2020
Status: Closed

Base: masterHead: feature/movie-support


📝 Commits (10+)

  • 64e528d Added ghostscript
  • 63e02e7 Added PDF mimetype and isInputPdf function
  • 488ee6a If it's a pdf use pgae no param
  • a640a69 Added pg param for PDF
  • 5ac06b3 Changed parameter name to be more generic, appends page number to cached image
  • 621580e Added movie support
  • 1a6c2bd Fixed current unit tests
  • f57ea1b code style
  • e86fb59 Cleaned up and added and exception if the time is out of range
  • cbe1b0e Commenting and a little refactor

📊 Changes

13 files changed (+247 additions, -4 deletions)

View changed files

📝 Dockerfile (+4 -1)
📝 config/parameters.yml (+4 -0)
📝 src/Core/Entity/Image/InputImage.php (+41 -1)
📝 src/Core/Entity/Image/OutputImage.php (+46 -0)
📝 src/Core/Entity/ImageMetaInfo.php (+1 -1)
📝 src/Core/Processor/ImageProcessor.php (+4 -1)
📝 src/Core/Processor/Processor.php (+3 -0)
src/Core/Processor/VideoProcessor.php (+61 -0)
📝 tests/Core/BaseTest.php (+4 -0)
📝 tests/Core/Controller/DefaultControllerTest.php (+77 -0)
📝 tests/Core/Entity/Image/OutputImageTest.php (+2 -0)
tests/testImages/SampleVideo_1280x720_2mb.mp4 (+0 -0)
tests/testImages/lighthouses.pdf (+0 -0)

📄 Description

RE issue #241

PDF's.

Requires ghostscript

This generates an image for page 1. (no page specified).
http://127.0.0.1:8080/upload/w_1024,h_1024,q_75/https://example.com/seasons.pdf

Adding pg_[n] generates a specific page. E.g. this would generate page 3.
http://127.0.0.1:8080/upload/w_1024,h_1024,q_75,pg_3/https://example.com/seasons.pdf

When the cached image is generated I'm appending '-1', '-2', '-3' etc to it depending on the page requested. No page specified defaults to appending '-1'.

MOVIES

Requires ffmpeg

This generates an image from 1 second duration. (no time specified).
http://127.0.0.1:8080/upload/w_1024,h_1024,q_75/https://example.com/my-movie.mp4

Adding tm_[n] generates a specific seconds. E.g. this would generate an image from 5 seconds duration.
http://127.0.0.1:8080/upload/w_1024,h_1024,q_75,tm_5/https://example.com/my-movie.mp4

The above could also be written as below which is how you would do minutes and hours:
http://127.0.0.1:8080/upload/w_1024,h_1024,q_75,tm_00:00:05/https://example.com/my-movie.mp4

See http://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax

I'm generating a full size image with ffmpeg to work from in the tmp directory, before generating the resized image.

When the cached image is generated I'm appending '-1' or '-000005' etc to it depending on the time requested. No time specified defaults to appending '-000001' ie first second of the movie.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/flyimg/flyimg/pull/243 **Author:** [@louisl](https://github.com/louisl) **Created:** 1/31/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/movie-support` --- ### 📝 Commits (10+) - [`64e528d`](https://github.com/flyimg/flyimg/commit/64e528d9b280fbf5a23888779c0925ec799a3f2e) Added ghostscript - [`63e02e7`](https://github.com/flyimg/flyimg/commit/63e02e71d0a7cfa3da29af25426702911e277dfd) Added PDF mimetype and isInputPdf function - [`488ee6a`](https://github.com/flyimg/flyimg/commit/488ee6a8242b05b3f6438dfa89b1f09acebce61f) If it's a pdf use pgae no param - [`a640a69`](https://github.com/flyimg/flyimg/commit/a640a6983a602343acd60b38bb5e62d72a1b1f7f) Added pg param for PDF - [`5ac06b3`](https://github.com/flyimg/flyimg/commit/5ac06b3f459a9060d8c656245d3b375048613a49) Changed parameter name to be more generic, appends page number to cached image - [`621580e`](https://github.com/flyimg/flyimg/commit/621580e84064f66fe6cce309b7d1c3dd2759514d) Added movie support - [`1a6c2bd`](https://github.com/flyimg/flyimg/commit/1a6c2bdcf085ce0b23f0f88876904e6ad4bdedf4) Fixed current unit tests - [`f57ea1b`](https://github.com/flyimg/flyimg/commit/f57ea1bfe7ee96cd27f5b952e7d55c96949eca12) code style - [`e86fb59`](https://github.com/flyimg/flyimg/commit/e86fb592101af5a9d05f9e345cee23d8e16bf41f) Cleaned up and added and exception if the time is out of range - [`cbe1b0e`](https://github.com/flyimg/flyimg/commit/cbe1b0efbd82a849ffc9c399101024041fd2178e) Commenting and a little refactor ### 📊 Changes **13 files changed** (+247 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+4 -1) 📝 `config/parameters.yml` (+4 -0) 📝 `src/Core/Entity/Image/InputImage.php` (+41 -1) 📝 `src/Core/Entity/Image/OutputImage.php` (+46 -0) 📝 `src/Core/Entity/ImageMetaInfo.php` (+1 -1) 📝 `src/Core/Processor/ImageProcessor.php` (+4 -1) 📝 `src/Core/Processor/Processor.php` (+3 -0) ➕ `src/Core/Processor/VideoProcessor.php` (+61 -0) 📝 `tests/Core/BaseTest.php` (+4 -0) 📝 `tests/Core/Controller/DefaultControllerTest.php` (+77 -0) 📝 `tests/Core/Entity/Image/OutputImageTest.php` (+2 -0) ➕ `tests/testImages/SampleVideo_1280x720_2mb.mp4` (+0 -0) ➕ `tests/testImages/lighthouses.pdf` (+0 -0) </details> ### 📄 Description RE issue #241 ## PDF's. Requires `ghostscript` This generates an image for page 1. (no page specified). `http://127.0.0.1:8080/upload/w_1024,h_1024,q_75/https://example.com/seasons.pdf` Adding `pg_[n]` generates a specific page. E.g. this would generate page 3. `http://127.0.0.1:8080/upload/w_1024,h_1024,q_75,pg_3/https://example.com/seasons.pdf` When the cached image is generated I'm appending '-1', '-2', '-3' etc to it depending on the page requested. No page specified defaults to appending '-1'. ## MOVIES Requires `ffmpeg` This generates an image from 1 second duration. (no time specified). `http://127.0.0.1:8080/upload/w_1024,h_1024,q_75/https://example.com/my-movie.mp4` Adding `tm_[n]` generates a specific seconds. E.g. this would generate an image from 5 seconds duration. `http://127.0.0.1:8080/upload/w_1024,h_1024,q_75,tm_5/https://example.com/my-movie.mp4` The above could also be written as below which is how you would do minutes and hours: `http://127.0.0.1:8080/upload/w_1024,h_1024,q_75,tm_00:00:05/https://example.com/my-movie.mp4` See http://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax I'm generating a full size image with ffmpeg to work from in the tmp directory, before generating the resized image. When the cached image is generated I'm appending '-1' or '-000005' etc to it depending on the time requested. No time specified defaults to appending '-000001' ie first second of the movie. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 15:44:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#958
No description provided.