Rename uploadCanvas to a more appropriate removeImageMetadata

Including backwards compatibility
This commit is contained in:
Nachtalb 2021-04-01 18:23:54 +02:00
parent 3a6ac4e5ec
commit 846da41b01
No known key found for this signature in database
GPG Key ID: E48DF13C07055D92
4 changed files with 21 additions and 8 deletions

View File

@ -242,15 +242,14 @@
<div> <div>
<label class="opt"> <label class="opt">
<input <input
:checked="$store.state.settings.uploadCanvas" :checked="$store.state.settings.removeImageMetadata"
type="checkbox" type="checkbox"
name="uploadCanvas" name="removeImageMetadata"
/> />
Attempt to remove metadata from images before uploading Attempt to remove metadata from images before uploading
<span <span
class="tooltipped tooltipped-n tooltipped-no-delay" class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="This option renders the image into a canvas element to remove metadata from the image. aria-label="This option will removes metadata from images and animated wepb files. This may break the images orientation."
This may break orientation if your browser does not support that."
> >
<button class="extra-help" /> <button class="extra-help" />
</span> </span>
@ -359,7 +358,7 @@ This may break orientation if your browser does not support that."
Custom highlights Custom highlights
<span <span
class="tooltipped tooltipped-n tooltipped-no-delay" class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="If a message contains any of these comma-separated aria-label="If a message contains any of these comma-separated
expressions, it will trigger a highlight." expressions, it will trigger a highlight."
> >
<button class="extra-help" /> <button class="extra-help" />
@ -382,8 +381,8 @@ expressions, it will trigger a highlight."
Highlight exceptions Highlight exceptions
<span <span
class="tooltipped tooltipped-n tooltipped-no-delay" class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="If a message contains any of these comma-separated aria-label="If a message contains any of these comma-separated
expressions, it will not trigger a highlight even if it contains expressions, it will not trigger a highlight even if it contains
your nickname or expressions defined in custom highlights." your nickname or expressions defined in custom highlights."
> >
<button class="extra-help" /> <button class="extra-help" />

View File

@ -98,7 +98,7 @@ export const config = normalizeConfig({
media: { media: {
default: true, default: true,
}, },
uploadCanvas: { removeImageMetadata: {
default: true, default: true,
}, },
userStyles: { userStyles: {

View File

@ -86,6 +86,15 @@ function loadFromLocalStorage() {
storedSettings.highlights = storedSettings.highlights.join(", "); storedSettings.highlights = storedSettings.highlights.join(", ");
} }
// Convert deprecated uploadCanvas to removeImageMetadata
if (
storedSettings.uploadCanvas !== undefined &&
storedSettings.removeImageMetadata === undefined
) {
storedSettings.removeImageMetadata = storedSettings.uploadCanvas;
delete storedSettings.uploadCanvas;
}
return storedSettings; return storedSettings;
} }

View File

@ -102,6 +102,11 @@ function Client(manager, name, config = {}) {
delete client.config.awayMessage; delete client.config.awayMessage;
} }
if (client.config.uploadCanvas) {
client.config.clientSettings.removeImageMetadata = client.config.uploadCanvas;
delete client.config.uploadCanvas;
}
if (client.config.clientSettings.awayMessage) { if (client.config.clientSettings.awayMessage) {
client.awayMessage = client.config.clientSettings.awayMessage; client.awayMessage = client.config.clientSettings.awayMessage;
} }