client+server: fixed style errors

This commit is contained in:
Shyam Sunder 2021-09-13 12:58:28 -04:00
parent 414106a477
commit e4a253fd25
6 changed files with 12 additions and 11 deletions

View file

@ -17,7 +17,7 @@ class HomeController {
buildDate: config.meta.buildDate,
canListSnapshots: api.hasPrivilege("snapshots:list"),
canListPosts: api.hasPrivilege("posts:list"),
isDevelopmentMode: config.environment == "development"
isDevelopmentMode: config.environment == "development",
});
Info.get().then(

View file

@ -196,11 +196,9 @@ class TagInputControl extends events.EventTarget {
const listItemNode = this._createListItemNode(tag);
if (!tag.category) {
listItemNode.classList.add("new");
}
else if (source === SOURCE_IMPLICATION) {
} else if (source === SOURCE_IMPLICATION) {
listItemNode.classList.add("implication");
}
else {
} else {
listItemNode.classList.add("added");
}
this._tagListNode.prependChild(listItemNode);

View file

@ -4,12 +4,12 @@ const config = require("./config.js");
if (config.environment == "development") {
var ws = new WebSocket("ws://" + location.hostname + ":8080");
ws.addEventListener('open', function (event) {
ws.addEventListener("open", function (event) {
console.log("Live-reloading websocket connected.");
});
ws.addEventListener('message', (event) => {
ws.addEventListener("message", (event) => {
console.log(event);
if (event.data == 'reload'){
if (event.data == "reload") {
location.reload();
}
});

View file

@ -5,14 +5,15 @@ from io import BytesIO
from typing import Any, Callable, List, Optional, Set, Tuple
import numpy as np
from PIL import Image
import pillow_avif
import pyheif
from PIL import Image
from pyheif_pillow_opener import register_heif_opener
register_heif_opener()
from szurubooru import config, errors
register_heif_opener()
logger = logging.getLogger(__name__)
# Math based on paper from H. Chi Wong, Marshall Bern and David Goldberg

View file

@ -6,6 +6,7 @@ import shlex
import subprocess
from io import BytesIO
from typing import List
from PIL import Image as PILImage
from szurubooru import errors
@ -17,7 +18,7 @@ logger = logging.getLogger(__name__)
def convert_heif_to_png(content: bytes) -> bytes:
img = PILImage.open(BytesIO(content))
img_byte_arr = BytesIO()
img.save(img_byte_arr, format='PNG')
img.save(img_byte_arr, format="PNG")
return img_byte_arr.getvalue()

View file

@ -88,6 +88,7 @@ def is_animated_gif(content: bytes) -> bool:
and len(re.findall(pattern, content)) > 1
)
def is_heif(mime_type: str) -> bool:
return mime_type.lower() in (
"image/heif",