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

generate user themed favicon and touchicon #38823

Merged
merged 1 commit into from
Jun 16, 2023
Merged

Conversation

szaimen
Copy link
Contributor

@szaimen szaimen commented Jun 14, 2023

The problem was that the color was not taken into account by the logic. So as soon as the icon is created and put into place in the theming directory, it gets never re-created by changing the color. My PR now takes the color of the icon into account by putting it into the file name. The same logic is alreaddy applied and funcitoning here:

$color = $this->themingDefaults->getColorPrimary();
try {
$iconFileName = $this->imageManager->getCachedImage('icon-' . $app . '-' . $color . str_replace('/', '_', $image));
} catch (NotFoundException $exception) {
$icon = $this->iconBuilder->colorSvg($app, $image);
if ($icon === false || $icon === '') {
return new NotFoundResponse();
}
$iconFileName = $this->imageManager->setCachedImage('icon-' . $app . '-' . $color . str_replace('/', '_', $image), $icon);

@szaimen szaimen added the 2. developing Work in progress label Jun 14, 2023
@szaimen szaimen added this to the Nextcloud 28 milestone Jun 14, 2023
@szaimen szaimen changed the title WIP - fix favicon and touchicon color generate user themed favicon and touchicon Jun 15, 2023
Signed-off-by: Simon L <szaimen@e.mail.de>
@szaimen szaimen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 15, 2023
@szaimen szaimen marked this pull request as ready for review June 15, 2023 22:24
@szaimen szaimen added the bug label Jun 15, 2023
@szaimen
Copy link
Contributor Author

szaimen commented Jun 15, 2023

/backport to stable27

@szaimen
Copy link
Contributor Author

szaimen commented Jun 15, 2023

/backport to stable26

@szaimen
Copy link
Contributor Author

szaimen commented Jun 15, 2023

/backport to stable25

@ChristophWurst

This comment was marked as resolved.

@szaimen
Copy link
Contributor Author

szaimen commented Jun 16, 2023

Could you describe why it was broken before and how your changes fix the problem? I am not familiar with this area of the server code

I adjusted the description

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@szaimen
Copy link
Contributor Author

szaimen commented Jun 16, 2023

Node failure unrelated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants