-
Notifications
You must be signed in to change notification settings - Fork 672
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
Icon resize #10721
Icon resize #10721
Conversation
The new resize lib expects a valid image extension in order to resize an image. Two problems existed, 1 when an image is uploaded it's stored in a tmp file without a valid image extension and 2 if called when logged out the file destination could not be created.
f602b40
to
638a47d
Compare
* @see https://github.com/Elgg/Elgg/issues/10686 | ||
* @return void|string | ||
*/ | ||
protected function getFileFormat($filename, $params) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Imagine to do this? We also have a similar method in one of the file related classes (see ElggFile::detectMimeType())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Imagine to do this?
I looked but couldn't find any
We also have a similar method in one of the file related classes (see ElggFile::detectMimeType())
maybe but $filename
doens't have to be in the Elgg file structure (eg uploaded file is in /tmp)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See \Elgg\Filesystem\MimeTypeDetector
, it's agnostic to Elgg's file system and works with file paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See \Elgg\Filesystem\MimeTypeDetector, it's agnostic to Elgg's file system and works with file paths.
I changed it, thanks for the tip
638a47d
to
6c0598a
Compare
Can we add a test to see what the expected outcome is? From the code it's unclear what issue this is fixing. |
6c0598a
to
53f75a9
Compare
I added 3 tests for resizing
|
Detect the correct image format to use for resizing an image based on supplied output format of mimetype of the source image fixes Elgg#10686
53f75a9
to
dd9af8a
Compare
fixed several problems with image resizing
ref #10686