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

File create.format blueprint option also converts mp4 to broken webp #6715

Closed
distantnative opened this issue Oct 2, 2024 · 4 comments · Fixed by #6718
Closed

File create.format blueprint option also converts mp4 to broken webp #6715

distantnative opened this issue Oct 2, 2024 · 4 comments · Fixed by #6718
Assignees
Labels
type: bug 🐛 Is a bug; fixes a bug
Milestone

Comments

@distantnative
Copy link
Member

create:
  width: 1920
  height: 1920
  format: webp

If the file blueprint also accept non-image files, those will be skipped and their format/extension left untouched.

This should leave mp4 files unchanged, but it doesn't.

Original report: https://forum.getkirby.com/t/convert-image-formats-on-upload-file-blueprint-option-does-not-ignore-video-files-produces-broken-files-as-a-result/32600

@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label Oct 2, 2024
@afbora
Copy link
Member

afbora commented Oct 2, 2024

I prefer moving changeExtension() calling process (after manipulate process) into ::manipulate() method. I think changeExtension process is part of manipulate action. What do you think?

// resize the file on upload if configured
$file = $file->manipulate($create);
$file = $file->changeExtension($file, $create['format'] ?? null);

@distantnative
Copy link
Member Author

Ahhh, I love how good you are at finding the sources of such issues. Yes, I think that's the problem that the extension gets changed even if manipulate exists without doing anything.

And your suggestion makes sense to me.

@francoislacruche
Copy link

Hi, I'm the OP of the issue on the forums. That means I should just wait for the next Kirby release, correct ? If yes, do you have a vague idea of how often fixes such as this one get implemented (or know somewhere I can learn more about your development process/roadmap) ?

Sorry if dumb questions, I'm curious but know little about such development environments.

@distantnative
Copy link
Member Author

@francoislacruche Im pretty sure this will be part of the next release (4.5) as we already know the origin of the bug and that the fix will relatively easy.

On other issues it can take sometimes months or years if they are hard to replicate or their solutions first requires a lot of dependencies.

But here we'll have one soon I'm confident.

@afbora afbora added this to the 4.5.0 milestone Oct 2, 2024
@afbora afbora self-assigned this Oct 2, 2024
@afbora afbora linked a pull request Oct 3, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants