Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaciras committed Aug 19, 2024
1 parent bb6a44f commit baa3354
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ic-analyzer",
"version": "0.2.1",
"version": "0.3.0",
"description": "Image Compression & Analysis Tool",
"author": "Kaciras <Kaciras@outlook.com>",
"license": "AGPL",
Expand Down
6 changes: 4 additions & 2 deletions web/app/EncoderPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import styles from "./EncoderPanel.css";
import OptionsForm from "../form/OptionsForm.tsx";
import { Merger } from "../hooks.ts";

const CONFIG_VERSION = 2;

export interface EncoderConfig {
enable: boolean;
state: OptionStateMap;
Expand All @@ -27,7 +29,7 @@ function newState(encoder: ImageEncoder) {
}

export function getEncodingOptions(saved?: EncodingOptions) {
const upgrade = (saved as any)?.version !== 1;
const upgrade = (saved as any)?.version !== CONFIG_VERSION;
const config = upgrade ? {} : saved!;

for (const encoder of ENCODERS) {
Expand All @@ -38,7 +40,7 @@ export function getEncodingOptions(saved?: EncodingOptions) {
}
if (upgrade) {
const { quality } = config.WebP.state;
(config as any).version = 1;
(config as any).version = CONFIG_VERSION;
config.WebP.enable = true;
quality.range.step = 5;
quality.isVariable = true;
Expand Down

0 comments on commit baa3354

Please sign in to comment.