Skip to content

Conversation

@nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Jul 10, 2024

Case Before After
Huge image 3308-1758-max 2188-710-max
Mini image 2188-740-max2

Todo

  • Create repair step to cache the image size on update
  • Adjustments for enterprise logo

Checklist

@nickvergessen nickvergessen force-pushed the bugfix/noid/limit-logo-size-for-outlook branch from ec3f2a7 to 7e6ce49 Compare July 11, 2024 06:54
@nickvergessen
Copy link
Member Author

Added the repair step and pinged the release crew to ask about the enterprise logo

}

if ($key === 'logo') {
$this->config->deleteAppValue('theming', 'logoDimensions');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\IConfig::deleteAppValue has been marked as deprecated
@nickvergessen nickvergessen force-pushed the bugfix/noid/limit-logo-size-for-outlook branch from 7e6ce49 to 0252003 Compare July 16, 2024 14:08
if ($key === 'logo') {
$newImage = @imagecreatefromstring(file_get_contents($tmpFile));
if ($newImage !== false) {
$this->config->setAppValue('theming', 'logoDimensions', imagesx($newImage) . 'x' . imagesy($newImage));

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\IConfig::setAppValue has been marked as deprecated
@nickvergessen nickvergessen force-pushed the bugfix/noid/limit-logo-size-for-outlook branch from 0252003 to c9842b6 Compare July 17, 2024 06:57
} elseif (str_starts_with($detectedMimeType, 'image/svg')) {
$matched = preg_match('/viewbox=["\']\d* \d* (\d*\.?\d*) (\d*\.?\d*)["\']/i', $content, $matches);
if ($matched) {
$this->config->setAppValue('theming', 'logoDimensions', $matches[1] . 'x' . $matches[2]);

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\IConfig::setAppValue has been marked as deprecated
$this->config->setAppValue('theming', 'logoDimensions', $matches[1] . 'x' . $matches[2]);
} else {
$this->logger->warning('Could not read logo image dimensions to optimize for mail header');
$this->config->deleteAppValue('theming', 'logoDimensions');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\IConfig::deleteAppValue has been marked as deprecated
}
} else {
$this->logger->warning('Could not read logo image dimensions to optimize for mail header');
$this->config->deleteAppValue('theming', 'logoDimensions');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\IConfig::deleteAppValue has been marked as deprecated
@nickvergessen nickvergessen force-pushed the bugfix/noid/limit-logo-size-for-outlook branch from c9842b6 to 37154e2 Compare July 17, 2024 07:18
@nickvergessen nickvergessen force-pushed the bugfix/noid/limit-logo-size-for-outlook branch from 37154e2 to 693a81b Compare July 17, 2024 07:25
@nickvergessen nickvergessen merged commit 0588899 into master Jul 17, 2024
@nickvergessen nickvergessen deleted the bugfix/noid/limit-logo-size-for-outlook branch July 17, 2024 09:54
@nickvergessen
Copy link
Member Author

/backport to stable29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants