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
profile: Support transparent icons (Trac #2648) #2648
Comments
Milestone changed to |
trac user twall wrote on 41347185-02-25 At first I looked at doing this by overriding the mod/profile upload actions (which have moved in 1.8), but that leaves un-fixed group icons and any other similar operations which might implement their own actions. So I looked to see if I could make a fix in a more central location. The image resizing in filestore discards transparency information in converting to jpg. Here is a partial solution to preserve transparency in filestore.php:get_resized_image_from_existing_file: Insert this code immediately before the call to imagecopyresampled:
and then instead of always outputting jpeg:
I haven't checked whether any callers of this function depend on the result being in jpeg format. I've also arbitrarily limited the size to 200x200, since you'll probably want jpeg for larger images, which aren't as likely as icons to have transparency. Anyhow, the above patches work to allow transparency in uploaded user and group icons. |
cash wrote on 41431226-06-23 Elgg needs a standard way to handle images (including routing without the full engine being loaded). I'm thinking that we can use something like the new cache handler that we added in 1.8. |
@hypeJunction another images-related ticket :) |
There are too many :) let's create a milestone for a rewrite. And let's agree on an image manipulation library |
Consolidating on #6152 |
Original ticket http://trac.elgg.org/ticket/2648 on 40865051-12-17 by trac user hellekin, assigned to unknown.
Elgg version: 1.7
There are some ".jpg" hardcoded in different files.
The functionality to upload and save transparent PNG icons is trivial.
But finding the right path for an image is a bit more tricky: using $user->icon_imagetype or creating an IconEntity?
Should $user->getIcon() return the right format from file metadata or from its own?
It belongs to profile but some code in core could be affected (FileStore)
The text was updated successfully, but these errors were encountered: