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
\OC_Helper::tmpFile can break Imagemagick #12282
Comments
In master, the function has moved to TempManager, but it has the same problem. If this is considered to be only an issue with Imagemagick, I could take care of the problem locally by adding the dot to $tmpfile, if extensions are normalised (3 chars), but this problem could affect other parts of the app. |
Updated the test case to make it easy to test |
@georgehrke What is your opinion? |
I think this will only affect ImageMagick as it tries to use the file extension in order to magically convert files it can't identify after a first parse. |
iirc you can hand over a suffix for \OC_Helper::tmpFile(), I'll check and prepare a pull request |
@oparoz Can you still reproduce it on latest master? This should have been fixed with your commit, as we are now using toTmpFile() which uses \OC_Helper::tmpFile with extensions. |
I need to rebase my patch to support font previews to be able to test. It's going to take a few days... |
Still a problem. |
The behaviour can be tested from within OC using this PR #13648 |
This is also killing any Raw picture conversion as these formats can embed other formats as well for quick previewing |
Fix is in #13654 |
Fixed via #13654 |
Steps to reproduce
OC generates temp filenames without any extension (i.e. .mp3). It concatenates everything instead.
This test case proves that this will break Imagemagick.
identify
to let Imagemagick determine what's in the fileTested with OTF fonts, but could happen with more file types down the line.
Expected behaviour
Imagemagick should be able to identify the file as an OTF font
Actual behaviour
Instead
If you rename the file so that extension is kept after the dot.
Server configuration
Operating system: FreeBSD
Web server: Apache
PHP version: 5.5 with Imagemagick 6.8 or 6.9
ownCloud version: 7.0.3
Updated from an older ownCloud or fresh install: Updated
The content of config/config.php:
Are you using encryption: no
The text was updated successfully, but these errors were encountered: