├── .DS_Store ├── .gitignore ├── assets ├── .DS_Store ├── background.png ├── icon.png ├── icons │ ├── arrow.png │ ├── clearAll-dark.png │ ├── clearAll-hover-dark.png │ ├── clearAll-hover.png │ ├── clearAll.png │ ├── close-hover.png │ ├── close.png │ ├── closeContainer-hover.png │ ├── closeContainer.png │ ├── cover-hover.png │ ├── cover.png │ ├── dark-hover.png │ ├── dark.png │ ├── deleteDuplicates-dark.png │ ├── deleteDuplicates-hover-dark.png │ ├── deleteDuplicates-hover.png │ ├── deleteDuplicates.png │ ├── flatten-hover.png │ ├── flatten.png │ ├── folder-hover.png │ ├── folder.png │ ├── icon.png │ ├── light-hover.png │ ├── light.png │ ├── location-hover.png │ ├── location.png │ ├── logo.png │ ├── maximize-hover.png │ ├── maximize.png │ ├── minimize-hover.png │ ├── minimize.png │ ├── mkv-hover.png │ ├── mkv.png │ ├── pdf-hover.png │ ├── pdf.png │ ├── previewClose-hover.png │ ├── previewClose.png │ ├── previewMaximize-hover.png │ ├── previewMaximize.png │ ├── previewMinimize-hover.png │ ├── previewMinimize.png │ ├── rename-hover.png │ ├── rename.png │ ├── star-hover.png │ ├── star.png │ ├── start-hover.png │ ├── start.png │ ├── startAll-dark.png │ ├── startAll-hover-dark.png │ ├── startAll-hover.png │ ├── startAll.png │ ├── stop-hover.png │ ├── stop.png │ ├── trash-hover.png │ ├── trash.png │ ├── update-hover.png │ ├── update.png │ ├── volume-thumb.png │ ├── vtt-hover.png │ ├── vtt.png │ ├── zoomIn-hover.png │ ├── zoomIn.png │ ├── zoomOut-hover.png │ └── zoomOut.png ├── images │ └── readme.png └── installer.bmp ├── components ├── FileContainer.tsx ├── FileContainerList.tsx ├── GroupAction.tsx ├── LogoBar.tsx ├── OptionsBar.tsx ├── PreviewTitleBar.tsx ├── TitleBar.tsx └── VersionDialog.tsx ├── declarations.d.ts ├── dev-app-update.yml ├── index.html ├── index.less ├── license.txt ├── main.ts ├── package-lock.json ├── package.json ├── patch ├── .DS_Store ├── cwebp-bin │ ├── .DS_Store │ ├── cli.js │ ├── index.js │ ├── lib │ │ ├── index.js │ │ └── install.js │ ├── license │ ├── package.json │ ├── readme.md │ └── vendor │ │ ├── cwebp │ │ └── source │ │ └── libwebp-1.2.1.tar.gz └── mozjpeg │ ├── .DS_Store │ ├── cli.js │ ├── index.js │ ├── lib │ ├── .DS_Store │ ├── index.js │ └── install.js │ ├── license │ ├── package.json │ ├── readme.md │ └── vendor │ ├── cjpeg │ └── source │ └── mozjpeg.tar.gz ├── poppler ├── .DS_Store ├── mac │ ├── .DS_Store │ ├── bin │ │ ├── pdfattach │ │ ├── pdfdetach │ │ ├── pdffonts │ │ ├── pdfimages │ │ ├── pdfinfo │ │ ├── pdfseparate │ │ ├── pdfsig │ │ ├── pdftocairo │ │ ├── pdftohtml │ │ ├── pdftoppm │ │ ├── pdftops │ │ ├── pdftotext │ │ ├── pdfunite │ │ └── pnmtojpeg │ └── lib │ │ ├── .DS_Store │ │ ├── libpoppler-cpp.0.10.0.dylib │ │ ├── libpoppler-cpp.0.dylib │ │ ├── libpoppler-cpp.a │ │ ├── libpoppler-cpp.dylib │ │ ├── libpoppler-glib.8.23.0.dylib │ │ ├── libpoppler-glib.8.dylib │ │ ├── libpoppler-glib.a │ │ ├── libpoppler-glib.dylib │ │ ├── libpoppler.122.0.0.dylib │ │ ├── libpoppler.122.dylib │ │ ├── libpoppler.a │ │ └── libpoppler.dylib └── windows │ ├── .DS_Store │ ├── bin │ ├── freetype6.dll │ ├── jpeg62.dll │ ├── libcairo-2.dll │ ├── libexpat-1.dll │ ├── libfontconfig-1.dll │ ├── libgcc_s_dw2-1.dll │ ├── libpixman-1-0.dll │ ├── libpng16-16.dll │ ├── libpoppler-79.dll │ ├── libpoppler-cpp-0.dll │ ├── libstdc++-6.dll │ ├── libtiff3.dll │ ├── pdfdetach.exe │ ├── pdffonts.exe │ ├── pdfimages.exe │ ├── pdfinfo.exe │ ├── pdfseparate.exe │ ├── pdftocairo.exe │ ├── pdftohtml.exe │ ├── pdftoppm.exe │ ├── pdftops.exe │ ├── pdftotext.exe │ ├── pdfunite.exe │ ├── pnmtojpeg.exe │ └── zlib1.dll │ └── lib │ ├── libpoppler-cpp.dll.a │ └── libpoppler.dll.a ├── preview.html ├── preview.less ├── preview.tsx ├── readme.md ├── renderer.tsx ├── structures └── functions.ts ├── styles ├── filecontainer.less ├── filecontainerlist.less ├── groupaction.less ├── logobar.less ├── optionsbar.less ├── previewtitlebar.less ├── titlebar.less └── versiondialog.less ├── tsconfig.json ├── vendor ├── .DS_Store ├── cjpeg ├── cjpeg.exe ├── cwebp ├── cwebp.exe ├── gifsicle ├── gifsicle.exe ├── pngquant └── pngquant.exe └── webpack.config.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | build 3 | node_modules 4 | .env 5 | .vscode 6 | .DS_Store -------------------------------------------------------------------------------- /assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/.DS_Store -------------------------------------------------------------------------------- /assets/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/background.png -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icon.png -------------------------------------------------------------------------------- /assets/icons/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/arrow.png -------------------------------------------------------------------------------- /assets/icons/clearAll-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/clearAll-dark.png -------------------------------------------------------------------------------- /assets/icons/clearAll-hover-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/clearAll-hover-dark.png -------------------------------------------------------------------------------- /assets/icons/clearAll-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/clearAll-hover.png -------------------------------------------------------------------------------- /assets/icons/clearAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/clearAll.png -------------------------------------------------------------------------------- /assets/icons/close-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/close-hover.png -------------------------------------------------------------------------------- /assets/icons/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/close.png -------------------------------------------------------------------------------- /assets/icons/closeContainer-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/closeContainer-hover.png -------------------------------------------------------------------------------- /assets/icons/closeContainer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/closeContainer.png -------------------------------------------------------------------------------- /assets/icons/cover-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/cover-hover.png -------------------------------------------------------------------------------- /assets/icons/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/cover.png -------------------------------------------------------------------------------- /assets/icons/dark-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/dark-hover.png -------------------------------------------------------------------------------- /assets/icons/dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/dark.png -------------------------------------------------------------------------------- /assets/icons/deleteDuplicates-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/deleteDuplicates-dark.png -------------------------------------------------------------------------------- /assets/icons/deleteDuplicates-hover-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/deleteDuplicates-hover-dark.png -------------------------------------------------------------------------------- /assets/icons/deleteDuplicates-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/deleteDuplicates-hover.png -------------------------------------------------------------------------------- /assets/icons/deleteDuplicates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/deleteDuplicates.png -------------------------------------------------------------------------------- /assets/icons/flatten-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/flatten-hover.png -------------------------------------------------------------------------------- /assets/icons/flatten.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/flatten.png -------------------------------------------------------------------------------- /assets/icons/folder-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/folder-hover.png -------------------------------------------------------------------------------- /assets/icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/folder.png -------------------------------------------------------------------------------- /assets/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/icon.png -------------------------------------------------------------------------------- /assets/icons/light-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/light-hover.png -------------------------------------------------------------------------------- /assets/icons/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/light.png -------------------------------------------------------------------------------- /assets/icons/location-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/location-hover.png -------------------------------------------------------------------------------- /assets/icons/location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/location.png -------------------------------------------------------------------------------- /assets/icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/logo.png -------------------------------------------------------------------------------- /assets/icons/maximize-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/maximize-hover.png -------------------------------------------------------------------------------- /assets/icons/maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/maximize.png -------------------------------------------------------------------------------- /assets/icons/minimize-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/minimize-hover.png -------------------------------------------------------------------------------- /assets/icons/minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/minimize.png -------------------------------------------------------------------------------- /assets/icons/mkv-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/mkv-hover.png -------------------------------------------------------------------------------- /assets/icons/mkv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/mkv.png -------------------------------------------------------------------------------- /assets/icons/pdf-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/pdf-hover.png -------------------------------------------------------------------------------- /assets/icons/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/pdf.png -------------------------------------------------------------------------------- /assets/icons/previewClose-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/previewClose-hover.png -------------------------------------------------------------------------------- /assets/icons/previewClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/previewClose.png -------------------------------------------------------------------------------- /assets/icons/previewMaximize-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/previewMaximize-hover.png -------------------------------------------------------------------------------- /assets/icons/previewMaximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/previewMaximize.png -------------------------------------------------------------------------------- /assets/icons/previewMinimize-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/previewMinimize-hover.png -------------------------------------------------------------------------------- /assets/icons/previewMinimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/previewMinimize.png -------------------------------------------------------------------------------- /assets/icons/rename-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/rename-hover.png -------------------------------------------------------------------------------- /assets/icons/rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/rename.png -------------------------------------------------------------------------------- /assets/icons/star-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/star-hover.png -------------------------------------------------------------------------------- /assets/icons/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/star.png -------------------------------------------------------------------------------- /assets/icons/start-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/start-hover.png -------------------------------------------------------------------------------- /assets/icons/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/start.png -------------------------------------------------------------------------------- /assets/icons/startAll-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/startAll-dark.png -------------------------------------------------------------------------------- /assets/icons/startAll-hover-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/startAll-hover-dark.png -------------------------------------------------------------------------------- /assets/icons/startAll-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/startAll-hover.png -------------------------------------------------------------------------------- /assets/icons/startAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/startAll.png -------------------------------------------------------------------------------- /assets/icons/stop-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/stop-hover.png -------------------------------------------------------------------------------- /assets/icons/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/stop.png -------------------------------------------------------------------------------- /assets/icons/trash-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/trash-hover.png -------------------------------------------------------------------------------- /assets/icons/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/trash.png -------------------------------------------------------------------------------- /assets/icons/update-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/update-hover.png -------------------------------------------------------------------------------- /assets/icons/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/update.png -------------------------------------------------------------------------------- /assets/icons/volume-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/volume-thumb.png -------------------------------------------------------------------------------- /assets/icons/vtt-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/vtt-hover.png -------------------------------------------------------------------------------- /assets/icons/vtt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/vtt.png -------------------------------------------------------------------------------- /assets/icons/zoomIn-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/zoomIn-hover.png -------------------------------------------------------------------------------- /assets/icons/zoomIn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/zoomIn.png -------------------------------------------------------------------------------- /assets/icons/zoomOut-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/zoomOut-hover.png -------------------------------------------------------------------------------- /assets/icons/zoomOut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/icons/zoomOut.png -------------------------------------------------------------------------------- /assets/images/readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/images/readme.png -------------------------------------------------------------------------------- /assets/installer.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/assets/installer.bmp -------------------------------------------------------------------------------- /components/FileContainer.tsx: -------------------------------------------------------------------------------- 1 | import {ipcRenderer, webFrame} from "electron" 2 | import {shell} from "@electron/remote" 3 | import path from "path" 4 | import React, {useContext, useEffect, useRef, useState, useReducer} from "react" 5 | import {ProgressBar} from "react-bootstrap" 6 | import pSBC from "shade-blend-color" 7 | import fs from "fs" 8 | import arrow from "../assets/icons/arrow.png" 9 | import closeContainerHover from "../assets/icons/closeContainer-hover.png" 10 | import closeContainer from "../assets/icons/closeContainer.png" 11 | import locationButtonHover from "../assets/icons/location-hover.png" 12 | import locationButton from "../assets/icons/location.png" 13 | import startButtonHover from "../assets/icons/start-hover.png" 14 | import startButton from "../assets/icons/start.png" 15 | import stopButtonHover from "../assets/icons/stop-hover.png" 16 | import stopButton from "../assets/icons/stop.png" 17 | import trashButtonHover from "../assets/icons/trash-hover.png" 18 | import trashButton from "../assets/icons/trash.png" 19 | import {DirectoryContext, QualityContext, OverwriteContext, IgnoreBelowContext, ResizeWidthContext, ResizeHeightContext, 20 | PercentageContext, KeepRatioContext, RenameContext, FormatContext, ProgressiveContext} from "../renderer" 21 | import functions from "../structures/functions" 22 | import "../styles/filecontainer.less" 23 | 24 | interface FileContainerProps { 25 | id: number 26 | remove: (id: number) => void 27 | setStart: (id: number) => void 28 | source: string 29 | height: number 30 | width: number 31 | fileSize: string 32 | } 33 | 34 | const FileContainer: React.FunctionComponent = (props: FileContainerProps) => { 35 | const {quality} = useContext(QualityContext) 36 | const {overwrite} = useContext(OverwriteContext) 37 | const {ignoreBelow} = useContext(IgnoreBelowContext) 38 | const {resizeWidth} = useContext(ResizeWidthContext) 39 | const {resizeHeight} = useContext(ResizeHeightContext) 40 | const {percentage} = useContext(PercentageContext) 41 | const {keepRatio} = useContext(KeepRatioContext) 42 | const {rename} = useContext(RenameContext) 43 | const {format} = useContext(FormatContext) 44 | const {progressive, setProgressive} = useContext(ProgressiveContext) 45 | const {directory, setDirectory} = useContext(DirectoryContext) 46 | const [hover, setHover] = useState(false) 47 | const [hoverClose, setHoverClose] = useState(false) 48 | const [hoverLocation, setHoverLocation] = useState(false) 49 | const [hoverTrash, setHoverTrash] = useState(false) 50 | const [hoverStart, setHoverStart] = useState(false) 51 | const [hoverStop, setHoverStop] = useState(false) 52 | const [output, setOutput] = useState("") 53 | const [started, setStarted] = useState(false) 54 | const [stopped, setStopped] = useState(false) 55 | const [deleted, setDeleted] = useState(false) 56 | const [skipped, setSkipped] = useState(false) 57 | const [progress, setProgress] = useState(null) as any 58 | const [progressColor, setProgressColor] = useState("") 59 | const [backgroundColor, setBackgroundColor] = useState("") 60 | const [progressLock, setProgressLock] = useState(false) 61 | const [startSignal, setStartSignal] = useState(false) 62 | const [clearSignal, setClearSignal] = useState(false) 63 | const [drag, setDrag] = useState(false) 64 | const [ignored, forceUpdate] = useReducer(x => x + 1, 0) 65 | const [newBuffer, setNewBuffer] = useState(null as unknown as Buffer) 66 | const [newFileSize, setNewFileSize] = useState("0KB") 67 | const [newDimension, setNewDimension] = useState(`${props.width}x${props.height}`) 68 | const progressBarRef = useRef(null) as React.RefObject 69 | const fileContainerRef = useRef(null) as React.RefObject 70 | 71 | useEffect(() => { 72 | const conversionStarted = (event: any, info: {id: number}) => { 73 | if (info.id === props.id) { 74 | setStarted(true) 75 | props.setStart(props.id) 76 | } 77 | } 78 | const conversionFinished = (event: any, info: {id: number, output: string, skipped: boolean, buffer?: Buffer, fileSize?: number}) => { 79 | if (info.id === props.id) { 80 | setOutput(info.output) 81 | if (info.skipped) setSkipped(info.skipped) 82 | if (info.buffer) setNewBuffer(info.buffer) 83 | if (info.fileSize) setNewFileSize(functions.readableFileSize(info.fileSize)) 84 | } 85 | } 86 | const deletedSource = (event: any, info: {id: number}) => { 87 | if (info.id === props.id) { 88 | setStarted(true) 89 | setOutput(props.source) 90 | setDeleted(true) 91 | } 92 | } 93 | const startAll = () => { 94 | setStartSignal(true) 95 | } 96 | const clearAll = () => { 97 | setClearSignal(true) 98 | } 99 | ipcRenderer.on("conversion-started", conversionStarted) 100 | ipcRenderer.on("conversion-finished", conversionFinished) 101 | ipcRenderer.on("start-all", startAll) 102 | ipcRenderer.on("clear-all", clearAll) 103 | ipcRenderer.on("update-color", forceUpdate) 104 | ipcRenderer.on("deleted-source", deletedSource) 105 | return () => { 106 | ipcRenderer.removeListener("conversion-started", conversionStarted) 107 | ipcRenderer.removeListener("conversion-finished", conversionFinished) 108 | ipcRenderer.removeListener("start-all", startAll) 109 | ipcRenderer.removeListener("clear-all", clearAll) 110 | ipcRenderer.removeListener("update-color", forceUpdate) 111 | ipcRenderer.removeListener("deleted-source", deletedSource) 112 | } 113 | }, []) 114 | 115 | useEffect(() => { 116 | updateProgressColor() 117 | updateBackgroundColor() 118 | if (!started && startSignal) startConversion(true) 119 | if ((!started || output) && clearSignal) closeConversion() 120 | }) 121 | 122 | useEffect(() => { 123 | updateRealtime() 124 | updateDimensions() 125 | }, [quality, ignoreBelow, resizeWidth, resizeHeight, percentage, keepRatio, format, progressive]) 126 | 127 | const updateRealtime = async () => { 128 | if (output) return 129 | const {buffer, fileSize} = await ipcRenderer.invoke("compress-realtime", {id: props.id, source: props.source, dest: directory, 130 | fileSize: props.fileSize, width: props.width, height: props.height, quality, overwrite, ignoreBelow, resizeWidth, resizeHeight, 131 | percentage, keepRatio, rename, format, progressive}) 132 | setNewBuffer(buffer) 133 | setNewFileSize(functions.readableFileSize(fileSize)) 134 | const type = format === "original" ? path.extname(props.source).replaceAll(".", "") : format 135 | ipcRenderer.invoke("preview-realtime", {id: props.id, newSource: functions.bufferToBase64(functions.arrayBufferToBuffer(buffer), type), newFileSize: functions.readableFileSize(fileSize)}) 136 | await functions.timeout(5000) 137 | } 138 | 139 | const updateDimensions = () => { 140 | if (output) return 141 | const {width, height} = functions.parseNewDimensions(props.width, props.height, resizeWidth, resizeHeight, percentage, keepRatio) 142 | setNewDimension(`${width}x${height}`) 143 | } 144 | 145 | const startConversion = async (startAll?: boolean) => { 146 | if (started) return 147 | setStartSignal(false) 148 | webFrame.clearCache() 149 | await functions.timeout(props.id) 150 | ipcRenderer.invoke("compress", {id: props.id, source: props.source, dest: directory, fileSize: props.fileSize, width: props.width, 151 | height: props.height, quality, overwrite, ignoreBelow, resizeWidth, resizeHeight, percentage, keepRatio, rename, format, progressive}, startAll) 152 | if (!startAll) { 153 | setStarted(true) 154 | props.setStart(props.id) 155 | } 156 | } 157 | 158 | const closeConversion = () => { 159 | ipcRenderer.invoke("move-queue", props.id) 160 | if (!output) ipcRenderer.invoke("delete-conversion", props.id) 161 | ipcRenderer.invoke("close-conversion", props.id) 162 | props.remove(props.id) 163 | } 164 | 165 | const deleteConversion = async () => { 166 | if (deleted) return 167 | const success = await ipcRenderer.invoke("delete-conversion", props.id, true) 168 | if (success) { 169 | ipcRenderer.invoke("move-queue") 170 | setDeleted(true) 171 | } 172 | } 173 | 174 | const stopConversion = async () => { 175 | if (stopped) return 176 | if (output) return 177 | const success = await ipcRenderer.invoke("stop-conversion", props.id) 178 | if (success) { 179 | ipcRenderer.invoke("move-queue") 180 | setStopped(true) 181 | } 182 | } 183 | 184 | const updateBackgroundColor = async () => { 185 | const colors = ["#f63447"] 186 | const container = fileContainerRef.current?.querySelector(".file-container") as HTMLElement 187 | if (!container) return 188 | if (!backgroundColor) { 189 | const color = colors[Math.floor(Math.random() * colors.length)] 190 | setBackgroundColor(color) 191 | } 192 | const theme = await ipcRenderer.invoke("get-theme") 193 | if (theme === "light") { 194 | const text = fileContainerRef.current?.querySelectorAll(".file-text, .file-text-alt") as NodeListOf 195 | text.forEach((t) => { 196 | t.style.color = "black" 197 | }) 198 | container.style.backgroundColor = backgroundColor 199 | container.style.border = `4px solid ${pSBC(0.1, backgroundColor)}` 200 | } else { 201 | const text = fileContainerRef.current?.querySelectorAll(".file-text, .file-text-alt") as NodeListOf 202 | text.forEach((t) => { 203 | t.style.color = backgroundColor 204 | }) 205 | container.style.backgroundColor = "#090409" 206 | container.style.border = `4px solid #090409` 207 | } 208 | } 209 | 210 | const updateProgressColor = () => { 211 | const colors = ["#fc0025"] 212 | const progressBar = progressBarRef.current?.querySelector(".progress-bar") as HTMLElement 213 | if (started && !progressLock) { 214 | setProgressColor(colors[Math.floor(Math.random() * colors.length)]) 215 | setProgressLock(true) 216 | } 217 | if (output) setProgressColor("#2bffb5") 218 | if (skipped) setProgressColor("#ff40d9") 219 | if (stopped) setProgressColor("#ff2495") 220 | if (deleted) setProgressColor("#5b3bff") 221 | progressBar.style.backgroundColor = progressColor 222 | } 223 | 224 | const generateProgressBar = () => { 225 | let jsx =

Waiting...

226 | let progressJSX = 227 | if (started) { 228 | jsx =

Compressing...

229 | progressJSX = 230 | } 231 | if (progress !== null) { 232 | jsx =

Compressing... {progress.toFixed(2)}%

233 | progressJSX = 234 | } 235 | if (progress === 100) { 236 | jsx =

Finalizing...

237 | progressJSX = 238 | } 239 | if (output) { 240 | jsx =

Finished

241 | progressJSX = 242 | } 243 | if (skipped) { 244 | jsx =

Skipped

245 | progressJSX = 246 | } 247 | if (stopped) { 248 | jsx =

Stopped

249 | progressJSX = 250 | } 251 | if (deleted) { 252 | jsx =

Deleted

253 | progressJSX = 254 | } 255 | return ( 256 | <> 257 |
{jsx}
258 | {progressJSX} 259 | 260 | ) 261 | } 262 | 263 | const mouseEnter = () => { 264 | document.documentElement.style.setProperty("--selection-color", pSBC(0.5, backgroundColor)) 265 | } 266 | 267 | const mouseLeave = () => { 268 | setHover(false) 269 | document.documentElement.style.setProperty("--selection-color", "#ffb5cb") 270 | } 271 | 272 | const openLocation = (direct?: boolean) => { 273 | const location = output ? output : props.source 274 | if (!fs.existsSync(location)) return 275 | if (direct) { 276 | shell.openPath(path.normalize(location)) 277 | } else { 278 | shell.showItemInFolder(path.normalize(location)) 279 | } 280 | } 281 | 282 | const diffPercentage = () => { 283 | const oldSize = functions.parseFileSize(props.fileSize) 284 | const newSize = functions.parseFileSize(newFileSize) 285 | if (oldSize > newSize) { 286 | const percent = (1 - (newSize / oldSize)) * 100 287 | return ` -${parseInt(String(percent))}%` 288 | } else { 289 | const percent = ((newSize / oldSize) - 1) * 100 290 | return ` +${parseInt(String(percent))}%` 291 | } 292 | } 293 | 294 | const preview = (event: React.MouseEvent) => { 295 | const title = output ? functions.cleanTitle(path.basename(output)) : functions.cleanTitle(path.basename(props.source)) 296 | const type = format === "original" ? path.extname(props.source).replaceAll(".", "") : format 297 | if (event.button === 2) ipcRenderer.invoke("preview", {id: props.id, title, source: props.source, fileSize: props.fileSize, newSource: functions.bufferToBase64(functions.arrayBufferToBuffer(newBuffer), type), newFileSize}) 298 | } 299 | 300 | const delayPress = (event: React.MouseEvent) => { 301 | if (event.button === 2) return event.stopPropagation() 302 | } 303 | 304 | return ( 305 |
setHover(true)} onMouseEnter={mouseEnter} onMouseLeave={mouseLeave}> 306 |
setHover(true)} onMouseLeave={() => setHover(false)} onMouseDown={() => setDrag(false)} onMouseMove={() => setDrag(true)}> 307 |
308 | 309 |
310 |
311 |
312 |
313 |

openLocation(true)}>{output ? functions.cleanTitle(path.basename(output)) : functions.cleanTitle(path.basename(props.source))}

314 |

{diffPercentage()}

315 |
316 |
317 |

event.stopPropagation()}>{props.fileSize}

318 | event.stopPropagation()}/> 319 |

event.stopPropagation()}>{newFileSize}

320 |
321 |
322 |

event.stopPropagation()}>{props.width}x{props.height}

323 | event.stopPropagation()}/> 324 |

event.stopPropagation()}>{newDimension}

325 |
326 |
327 |
328 | {generateProgressBar()} 329 |
330 |
331 |
332 | {hover ? event.stopPropagation()} src={hoverClose ? closeContainerHover : closeContainer} onClick={closeConversion} onMouseEnter={() => setHoverClose(true)} onMouseLeave={() => setHoverClose(false)}/> : null} 333 |
334 | event.stopPropagation()} onClick={() => {started ? stopConversion() : startConversion()}} src={started ? (hoverStop ? stopButtonHover : stopButton) : (hoverStart ? startButtonHover : startButton)} onMouseEnter={() => {setHoverStart(true); setHoverStop(true)}} onMouseLeave={() => {setHoverStart(false); setHoverStop(false)}}/> 335 |
336 |
337 | {output ? event.stopPropagation()} src={hoverLocation ? locationButtonHover : locationButton} onClick={() => openLocation()} onMouseEnter={() => setHoverLocation(true)} onMouseLeave={() => setHoverLocation(false)}/> : null} 338 | {output ? event.stopPropagation()} src={hoverTrash ? trashButtonHover : trashButton} onClick={deleteConversion} onMouseEnter={() => setHoverTrash(true)} onMouseLeave={() => setHoverTrash(false)}/> : null} 339 |
340 |
341 |
342 |
343 | ) 344 | } 345 | 346 | export default FileContainer -------------------------------------------------------------------------------- /components/FileContainerList.tsx: -------------------------------------------------------------------------------- 1 | import {ipcRenderer} from "electron" 2 | import fs from "fs" 3 | import React, {useContext, useEffect, useState} from "react" 4 | import Reorder from "react-reorder" 5 | import {ClearAllContext} from "../renderer" 6 | import functions from "../structures/functions" 7 | import "../styles/filecontainerlist.less" 8 | import FileContainer from "./FileContainer" 9 | 10 | const FileContainerList: React.FunctionComponent = (props) => { 11 | const {clearAll, setClearAll} = useContext(ClearAllContext) 12 | const [containers, setContainers] = useState([] as Array<{id: number, started: boolean, jsx: any}>) 13 | const [addSignal, setAddSignal] = useState(null) as any 14 | useEffect(() => { 15 | const addFile = async (event: any, file: string, pos: number, id: number) => { 16 | setAddSignal({file, pos, id}) 17 | } 18 | const addFiles = async (event: any, files: string[], identifiers: number[]) => { 19 | for (let i = 0; i < files.length; i++) { 20 | const dimensions = await ipcRenderer.invoke("get-dimensions", files[i]) 21 | const fileSize = functions.readableFileSize(fs.statSync(files[i]).size) 22 | setContainers((prev) => { 23 | let newState = [...prev] 24 | newState = [...newState, {id: identifiers[i], started: false, jsx: }] 25 | return newState 26 | }) 27 | } 28 | } 29 | ipcRenderer.on("add-files", addFiles) 30 | ipcRenderer.on("add-file-id", addFile) 31 | return () => { 32 | ipcRenderer.removeListener("add-files", addFiles) 33 | ipcRenderer.removeListener("add-file-id", addFile) 34 | } 35 | }, []) 36 | 37 | useEffect(() => { 38 | update() 39 | if (addSignal) addSignalFunc() 40 | }) 41 | 42 | const addSignalFunc = async () => { 43 | const signal = Object.assign({}, addSignal) 44 | setAddSignal(null) 45 | let index = containers.findIndex((c) => c?.id === signal.pos) 46 | if (index === -1) index = containers.length 47 | const dimensions = await ipcRenderer.invoke("get-dimensions", signal.file) 48 | const fileSize = functions.readableFileSize(fs.statSync(signal.file).size) 49 | setContainers((prev) => { 50 | const newState = [...prev] 51 | newState.splice(index + 1, 0, {id: signal.id, started: false, jsx: }) 52 | return newState 53 | }) 54 | } 55 | 56 | const update = () => { 57 | let found = containers.length ? true : false 58 | setClearAll(found) 59 | } 60 | 61 | const removeContainer = (id: number) => { 62 | setContainers((prev) => { 63 | const newState = [...prev] 64 | const index = newState.findIndex((c) => c?.id === id) 65 | if (index !== -1) newState.splice(index, 1) 66 | return newState 67 | }) 68 | } 69 | 70 | const setStarted = (id: number) => { 71 | setContainers((prev) => { 72 | const newState = [...prev] 73 | const index = newState.findIndex((c) => c.id === id) 74 | if (index !== -1) newState[index].started = true 75 | return newState 76 | }) 77 | } 78 | 79 | const reorder = (event: React.MouseEvent, from: number, to: number) => { 80 | setContainers((prev) => { 81 | const newState = [...prev] 82 | newState.splice(to, 0, newState.splice(from, 1)[0]) 83 | return newState 84 | }) 85 | } 86 | 87 | return ( 88 | { 89 | containers.map((c) => ( 90 |
  • 91 | {c.jsx} 92 |
  • 93 | )) 94 | }
    95 | ) 96 | } 97 | 98 | export default FileContainerList -------------------------------------------------------------------------------- /components/GroupAction.tsx: -------------------------------------------------------------------------------- 1 | import {ipcRenderer} from "electron" 2 | import React, {useContext, useState, useEffect} from "react" 3 | import clearAllButtonHover from "../assets/icons/clearAll-hover.png" 4 | import clearAllButton from "../assets/icons/clearAll.png" 5 | import clearAllButtonDarkHover from "../assets/icons/clearAll-hover-dark.png" 6 | import clearAllButtonDark from "../assets/icons/clearAll-dark.png" 7 | import startAllButtonHover from "../assets/icons/startAll-hover.png" 8 | import startAllButton from "../assets/icons/startAll.png" 9 | import startAllButtonDarkHover from "../assets/icons/startAll-hover-dark.png" 10 | import startAllButtonDark from "../assets/icons/startAll-dark.png" 11 | import deleteDuplicatesButtonHover from "../assets/icons/deleteDuplicates-hover.png" 12 | import deleteDuplicatesButton from "../assets/icons/deleteDuplicates.png" 13 | import deleteDuplicatesButtonDarkHover from "../assets/icons/deleteDuplicates-hover-dark.png" 14 | import deleteDuplicatesButtonDark from "../assets/icons/deleteDuplicates-dark.png" 15 | import {ClearAllContext} from "../renderer" 16 | import "../styles/groupaction.less" 17 | 18 | const GroupAction: React.FunctionComponent = (props) => { 19 | const {clearAll, setClearAll} = useContext(ClearAllContext) 20 | const [startHover, setStartHover] = useState(false) 21 | const [clearHover, setClearHover] = useState(false) 22 | const [deleteHover, setDeleteHover] = useState(false) 23 | const [color, setColor] = useState("light") 24 | 25 | useEffect(() => { 26 | const updateColor = (event: any, color: string) => { 27 | setColor(color) 28 | } 29 | ipcRenderer.on("update-color", updateColor) 30 | return () => { 31 | ipcRenderer.removeListener("update-color", updateColor) 32 | } 33 | }, []) 34 | 35 | const start = () => { 36 | ipcRenderer.invoke("start-all") 37 | setStartHover(false) 38 | } 39 | 40 | const clear = () => { 41 | ipcRenderer.invoke("clear-all") 42 | setClearHover(false) 43 | } 44 | 45 | const deleteDupes = () => { 46 | ipcRenderer.invoke("delete-duplicates") 47 | setDeleteHover(false) 48 | } 49 | 50 | const getImage = (type: string) => { 51 | if (type === "start") { 52 | if (color === "light") { 53 | if (startHover) { 54 | return startAllButtonHover 55 | } else { 56 | return startAllButton 57 | } 58 | } else { 59 | if (startHover) { 60 | return startAllButtonDarkHover 61 | } else { 62 | return startAllButtonDark 63 | } 64 | } 65 | } else if (type === "clear") { 66 | if (color === "light") { 67 | if (clearHover) { 68 | return clearAllButtonHover 69 | } else { 70 | return clearAllButton 71 | } 72 | } else { 73 | if (clearHover) { 74 | return clearAllButtonDarkHover 75 | } else { 76 | return clearAllButtonDark 77 | } 78 | } 79 | } else if (type === "delete") { 80 | if (color === "light") { 81 | if (deleteHover) { 82 | return deleteDuplicatesButtonHover 83 | } else { 84 | return deleteDuplicatesButton 85 | } 86 | } else { 87 | if (deleteHover) { 88 | return deleteDuplicatesButtonDarkHover 89 | } else { 90 | return deleteDuplicatesButtonDark 91 | } 92 | } 93 | } 94 | } 95 | 96 | if (clearAll) { 97 | return ( 98 |
    99 | setStartHover(true)} onMouseLeave={() => setStartHover(false)}/> 100 | setClearHover(true)} onMouseLeave={() => setClearHover(false)}/> 101 | setDeleteHover(true)} onMouseLeave={() => setDeleteHover(false)}/> 102 |
    103 | ) 104 | } 105 | return null 106 | } 107 | 108 | export default GroupAction -------------------------------------------------------------------------------- /components/LogoBar.tsx: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from "react" 2 | import logo from "../assets/icons/logo.png" 3 | import functions from "../structures/functions" 4 | import "../styles/logobar.less" 5 | 6 | const LogoBar: React.FunctionComponent = (props) => { 7 | return ( 8 |
    9 |
    10 | 11 |
    12 |
    13 |
    14 | ) 15 | } 16 | 17 | export default LogoBar 18 | -------------------------------------------------------------------------------- /components/OptionsBar.tsx: -------------------------------------------------------------------------------- 1 | import {ipcRenderer} from "electron" 2 | import {shell} from "@electron/remote" 3 | import React, {useContext, useEffect, useState} from "react" 4 | import {Dropdown, DropdownButton} from "react-bootstrap" 5 | import folderButton from "../assets/icons/folder.png" 6 | import folderButtonHover from "../assets/icons/folder-hover.png" 7 | import {DirectoryContext, QualityContext, OverwriteContext, IgnoreBelowContext, ResizeWidthContext, 8 | ResizeHeightContext, PercentageContext, KeepRatioContext, RenameContext, FormatContext, ProgressiveContext} from "../renderer" 9 | import Slider from "rc-slider" 10 | import functions from "../structures/functions" 11 | import "../styles/optionsbar.less" 12 | 13 | const OptionsBar: React.FunctionComponent = (props) => { 14 | const {quality, setQuality} = useContext(QualityContext) 15 | const {overwrite, setOverwrite} = useContext(OverwriteContext) 16 | const {ignoreBelow, setIgnoreBelow} = useContext(IgnoreBelowContext) 17 | const {resizeWidth, setResizeWidth} = useContext(ResizeWidthContext) 18 | const {resizeHeight, setResizeHeight} = useContext(ResizeHeightContext) 19 | const {percentage, setPercentage} = useContext(PercentageContext) 20 | const {keepRatio, setKeepRatio} = useContext(KeepRatioContext) 21 | const {rename, setRename} = useContext(RenameContext) 22 | const {format, setFormat} = useContext(FormatContext) 23 | const {directory, setDirectory} = useContext(DirectoryContext) 24 | const {progressive, setProgressive} = useContext(ProgressiveContext) 25 | const [folderHover, setFolderHover] = useState(false) 26 | const [id, setID] = useState(1) 27 | 28 | useEffect(() => { 29 | ipcRenderer.invoke("get-downloads-folder").then((f) => setDirectory(f)) 30 | initSettings() 31 | const addFile = (event: any, file: string, pos: number) => { 32 | setID((prev) => { 33 | ipcRenderer.invoke("add-file-id", file, pos, prev) 34 | return prev + 1 35 | }) 36 | } 37 | ipcRenderer.on("add-file", addFile) 38 | ipcRenderer.on("upload", upload) 39 | return () => { 40 | ipcRenderer.removeListener("add-file", addFile) 41 | ipcRenderer.removeListener("upload", upload) 42 | } 43 | }, []) 44 | 45 | useEffect(() => { 46 | ipcRenderer.invoke("store-settings", {quality, directory, overwrite, ignoreBelow, resizeWidth, resizeHeight, 47 | percentage, keepRatio, rename, format, progressive}) 48 | ipcRenderer.on("on-drop", onDrop) 49 | return () => { 50 | ipcRenderer.removeListener("on-drop", onDrop) 51 | } 52 | }) 53 | 54 | const initSettings = async () => { 55 | const settings = await ipcRenderer.invoke("init-settings") 56 | if (settings) { 57 | setQuality(settings.quality) 58 | setOverwrite(settings.overwrite) 59 | setIgnoreBelow(settings.ignoreBelow) 60 | setResizeWidth(settings.resizeWidth) 61 | setResizeHeight(settings.resizeHeight) 62 | setPercentage(settings.percentage) 63 | setKeepRatio(settings.keepRatio) 64 | setRename(settings.rename) 65 | setFormat(settings.format) 66 | setProgressive(settings.progressive) 67 | } 68 | } 69 | 70 | const changeDirectory = async () => { 71 | const dir = await ipcRenderer.invoke("select-directory") 72 | if (dir) setDirectory(dir) 73 | } 74 | 75 | const handleIgnoreBelow = (event: React.ChangeEvent) => { 76 | const value = event.target.value 77 | setIgnoreBelow(value) 78 | } 79 | 80 | const handleResizeWidth = (event: React.ChangeEvent) => { 81 | const value = event.target.value 82 | setResizeWidth(value) 83 | } 84 | 85 | const handleResizeHeight = (event: React.ChangeEvent) => { 86 | const value = event.target.value 87 | setResizeHeight(value) 88 | } 89 | 90 | const handleRename = (event: React.ChangeEvent) => { 91 | const value = event.target.value 92 | setRename(value) 93 | } 94 | 95 | const onDrop = (event: any, files: any) => { 96 | if (files[0]) { 97 | const identifers = [] 98 | let counter = id 99 | for (let i = 0; i < files.length; i++) { 100 | if (!functions.getType(files[i])) continue 101 | identifers.push(counter) 102 | counter += 1 103 | setID((prev) => prev + 1) 104 | } 105 | ipcRenderer.invoke("add-files", files, identifers) 106 | } 107 | } 108 | 109 | const upload = async () => { 110 | const files = await ipcRenderer.invoke("select-files") 111 | if (files[0]) { 112 | const identifers = [] 113 | let counter = id 114 | for (let i = 0; i < files.length; i++) { 115 | if (!functions.getType(files[i])) continue 116 | identifers.push(counter) 117 | counter += 1 118 | setID((prev) => prev + 1) 119 | } 120 | ipcRenderer.invoke("add-files", files, identifers) 121 | } 122 | } 123 | 124 | return ( 125 |
    126 |
    127 | 128 |

    Quality:

    129 | setQuality(value)} min={1} max={100} step={1} value={quality}/> 130 |

    {quality}%

    131 |
    132 |
    133 |
    134 | setFolderHover(true)} onMouseLeave={() => setFolderHover(false)} onClick={changeDirectory}/> 135 |

    shell.openPath(directory)}>{directory}

    136 |
    137 |
    138 | setOverwrite((prev: boolean) => !prev)}/> 139 |

    setOverwrite((prev: boolean) => !prev)}>Overwrite

    140 |
    141 |
    142 |

    Ignore Below:

    143 | 144 |
    145 |
    146 |
    147 |
    148 | setPercentage((prev: boolean) => !prev)}/> 149 |

    setPercentage((prev: boolean) => !prev)}>Percentage

    150 |
    151 |
    152 | setKeepRatio((prev: boolean) => !prev)}/> 153 |

    setKeepRatio((prev: boolean) => !prev)}>Keep Ratio

    154 |
    155 | {keepRatio ? 156 |
    157 |

    Resize:

    158 | 159 |

    {percentage ? "%" : "px"}

    160 |
    161 | : 162 | <> 163 |
    164 |

    Width:

    165 | 166 |

    {percentage ? "%" : "px"}

    167 |
    168 |
    169 |

    Height:

    170 | 171 |

    {percentage ? "%" : "px"}

    172 |
    173 | 174 | } 175 |
    176 |
    177 |
    178 |

    Rename:

    179 | 180 |
    181 |
    182 |

    Format:

    183 | 184 | setFormat("original")}>original 185 | setFormat("png")}>png 186 | setFormat("jpg")}>jpg 187 | setFormat("gif")}>gif 188 | setFormat("webp")}>webp 189 | setFormat("avif")}>avif 190 | setFormat("jxl")}>jxl 191 | 192 |
    193 |
    194 | setProgressive((prev: boolean) => !prev)}/> 195 |

    setProgressive((prev: boolean) => !prev)}>Progressive

    196 |
    197 |
    198 |
    199 | ) 200 | } 201 | 202 | export default OptionsBar -------------------------------------------------------------------------------- /components/PreviewTitleBar.tsx: -------------------------------------------------------------------------------- 1 | import React, {useState, useEffect} from "react" 2 | import {ipcRenderer} from "electron" 3 | import {getCurrentWindow} from "@electron/remote" 4 | import minimizeButton from "../assets/icons/previewMinimize.png" 5 | import maximizeButton from "../assets/icons/previewMaximize.png" 6 | import closeButton from "../assets/icons/previewClose.png" 7 | import minimizeButtonHover from "../assets/icons/previewMinimize-hover.png" 8 | import maximizeButtonHover from "../assets/icons/previewMaximize-hover.png" 9 | import closeButtonHover from "../assets/icons/previewClose-hover.png" 10 | import zoomInButton from "../assets/icons/zoomIn.png" 11 | import zoomInButtonHover from "../assets/icons/zoomIn-hover.png" 12 | import zoomOutButton from "../assets/icons/zoomOut.png" 13 | import zoomOutButtonHover from "../assets/icons/zoomOut-hover.png" 14 | import "../styles/previewtitlebar.less" 15 | 16 | interface PreviewTitleBarProps { 17 | title: string 18 | } 19 | 20 | const PreviewTitleBar: React.FunctionComponent = (props: PreviewTitleBarProps) => { 21 | let [hoverClose, setHoverClose] = useState(false) 22 | let [hoverMin, setHoverMin] = useState(false) 23 | let [hoverMax, setHoverMax] = useState(false) 24 | let [hoverIn, setHoverIn] = useState(false) 25 | let [hoverOut, setHoverOut] = useState(false) 26 | 27 | const minimize = () => { 28 | getCurrentWindow().minimize() 29 | } 30 | 31 | const maximize = () => { 32 | const window = getCurrentWindow() 33 | if (window.isMaximized()) { 34 | window.unmaximize() 35 | } else { 36 | window.maximize() 37 | } 38 | } 39 | 40 | const close = () => { 41 | getCurrentWindow().close() 42 | } 43 | 44 | const zoomOut = () => { 45 | ipcRenderer.invoke("zoom-out") 46 | } 47 | 48 | const zoomIn = () => { 49 | ipcRenderer.invoke("zoom-in") 50 | } 51 | 52 | return ( 53 |
    54 |
    55 |
    56 | setHoverOut(true)} onMouseLeave={() => setHoverOut(false)}/> 57 | setHoverIn(true)} onMouseLeave={() => setHoverIn(false)}/> 58 |
    59 |
    {props.title}
    60 |
    61 | setHoverMin(true)} onMouseLeave={() => setHoverMin(false)}/> 62 | setHoverMax(true)} onMouseLeave={() => setHoverMax(false)}/> 63 | setHoverClose(true)} onMouseLeave={() => setHoverClose(false)}/> 64 |
    65 |
    66 |
    67 | ) 68 | } 69 | 70 | export default PreviewTitleBar -------------------------------------------------------------------------------- /components/TitleBar.tsx: -------------------------------------------------------------------------------- 1 | import {ipcRenderer} from "electron" 2 | import {getCurrentWindow, shell} from "@electron/remote" 3 | import React, {useEffect, useState} from "react" 4 | import closeButtonHover from "../assets/icons/close-hover.png" 5 | import closeButton from "../assets/icons/close.png" 6 | import appIcon from "../assets/icons/icon.png" 7 | import maximizeButtonHover from "../assets/icons/maximize-hover.png" 8 | import maximizeButton from "../assets/icons/maximize.png" 9 | import minimizeButtonHover from "../assets/icons/minimize-hover.png" 10 | import minimizeButton from "../assets/icons/minimize.png" 11 | import starButtonHover from "../assets/icons/star-hover.png" 12 | import starButton from "../assets/icons/star.png" 13 | import updateButtonHover from "../assets/icons/update-hover.png" 14 | import updateButton from "../assets/icons/update.png" 15 | import pack from "../package.json" 16 | import lightButton from "../assets/icons/light.png" 17 | import lightButtonHover from "../assets/icons/light-hover.png" 18 | import darkButton from "../assets/icons/dark.png" 19 | import darkButtonHover from "../assets/icons/dark-hover.png" 20 | import flattenButton from "../assets/icons/flatten.png" 21 | import flattenButtonHover from "../assets/icons/flatten-hover.png" 22 | import pdfButton from "../assets/icons/pdf.png" 23 | import pdfButtonHover from "../assets/icons/pdf-hover.png" 24 | import coverButton from "../assets/icons/cover.png" 25 | import coverButtonHover from "../assets/icons/cover-hover.png" 26 | import renameButton from "../assets/icons/rename.png" 27 | import renameButtonHover from "../assets/icons/rename-hover.png" 28 | import vttButton from "../assets/icons/vtt.png" 29 | import vttButtonHover from "../assets/icons/vtt-hover.png" 30 | import "../styles/titlebar.less" 31 | 32 | const TitleBar: React.FunctionComponent = (props) => { 33 | const [hover, setHover] = useState(false) 34 | const [hoverClose, setHoverClose] = useState(false) 35 | const [hoverMin, setHoverMin] = useState(false) 36 | const [hoverMax, setHoverMax] = useState(false) 37 | const [hoverReload, setHoverReload] = useState(false) 38 | const [hoverStar, setHoverStar] = useState(false) 39 | const [hoverTheme, setHoverTheme] = useState(false) 40 | const [hoverFlatten, setHoverFlatten] = useState(false) 41 | const [hoverPDF, setHoverPDF] = useState(false) 42 | const [hoverCover, setHoverCover] = useState(false) 43 | const [hoverRename, setHoverRename] = useState(false) 44 | const [hoverVTT, setHoverVTT] = useState(false) 45 | const [theme, setTheme] = useState("light") 46 | 47 | useEffect(() => { 48 | ipcRenderer.invoke("check-for-updates", true) 49 | const initTheme = async () => { 50 | const saved = await ipcRenderer.invoke("get-theme") 51 | changeTheme(saved) 52 | } 53 | initTheme() 54 | }, []) 55 | 56 | const minimize = () => { 57 | getCurrentWindow().minimize() 58 | } 59 | 60 | const maximize = () => { 61 | const window = getCurrentWindow() 62 | if (window.isMaximized()) { 63 | window.unmaximize() 64 | } else { 65 | window.maximize() 66 | } 67 | } 68 | 69 | const close = () => { 70 | getCurrentWindow().close() 71 | } 72 | 73 | const star = () => { 74 | shell.openExternal(pack.repository.url) 75 | } 76 | 77 | const update = () => { 78 | ipcRenderer.invoke("check-for-updates", false) 79 | } 80 | 81 | const flatten = async () => { 82 | const directory = await ipcRenderer.invoke("flatten-directory") 83 | if (directory) ipcRenderer.invoke("flatten", directory) 84 | } 85 | 86 | const pdf = async () => { 87 | const files = await ipcRenderer.invoke("multi-open") 88 | if (files?.[0]) ipcRenderer.invoke("pdf", files) 89 | } 90 | 91 | const cover = async () => { 92 | const files = await ipcRenderer.invoke("multi-open", "cover") 93 | if (files?.[0]) ipcRenderer.invoke("pdf-cover", files) 94 | } 95 | 96 | const rename = async () => { 97 | const files = await ipcRenderer.invoke("multi-open", "rename") 98 | if (files?.[0]) ipcRenderer.invoke("rename", files) 99 | } 100 | 101 | const vtt = async () => { 102 | const files = await ipcRenderer.invoke("multi-open", "subs") 103 | //if (files?.[0]) ipcRenderer.invoke("remove-duplicate-subs", files) 104 | if (files?.[0]) ipcRenderer.invoke("extract-subtitles", files) 105 | } 106 | 107 | const changeTheme = (value?: string) => { 108 | let condition = value !== undefined ? value === "dark" : theme === "light" 109 | if (condition) { 110 | document.documentElement.style.setProperty("--bg-color", "#090409") 111 | document.documentElement.style.setProperty("--title-color", "#090409") 112 | document.documentElement.style.setProperty("--text-color", "#f33b37") 113 | document.documentElement.style.setProperty("--version-color", "#090409") 114 | document.documentElement.style.setProperty("--version-text", "#ff3a5b") 115 | document.documentElement.style.setProperty("--version-accept", "#090409") 116 | document.documentElement.style.setProperty("--version-accept-text", "#ff426b") 117 | document.documentElement.style.setProperty("--version-reject", "#090409") 118 | document.documentElement.style.setProperty("--version-reject-text", "#be3b57") 119 | setTheme("dark") 120 | ipcRenderer.invoke("save-theme", "dark") 121 | ipcRenderer.invoke("update-color", "dark") 122 | } else { 123 | document.documentElement.style.setProperty("--bg-color", "#e14952") 124 | document.documentElement.style.setProperty("--title-color", "#f33b37") 125 | document.documentElement.style.setProperty("--text-color", "black") 126 | document.documentElement.style.setProperty("--version-color", "#ff3a5b") 127 | document.documentElement.style.setProperty("--version-text", "black") 128 | document.documentElement.style.setProperty("--version-accept", "#ff426b") 129 | document.documentElement.style.setProperty("--version-accept-text", "black") 130 | document.documentElement.style.setProperty("--version-reject", "#be3b57") 131 | document.documentElement.style.setProperty("--version-reject-text", "black") 132 | setTheme("light") 133 | ipcRenderer.invoke("save-theme", "light") 134 | ipcRenderer.invoke("update-color", "light") 135 | } 136 | } 137 | 138 | return ( 139 |
    140 |
    141 |
    142 | 143 |

    Image Compressor v{pack.version}

    144 |
    145 |
    146 | changeTheme()} onMouseEnter={() => setHoverTheme(true)} onMouseLeave={() => setHoverTheme(false)}/> 147 | setHoverVTT(true)} onMouseLeave={() => setHoverVTT(false)}/> 148 | setHoverRename(true)} onMouseLeave={() => setHoverRename(false)}/> 149 | setHoverCover(true)} onMouseLeave={() => setHoverCover(false)}/> 150 | setHoverPDF(true)} onMouseLeave={() => setHoverPDF(false)}/> 151 | setHoverFlatten(true)} onMouseLeave={() => setHoverFlatten(false)}/> 152 | setHoverStar(true)} onMouseLeave={() => setHoverStar(false)}/> 153 | setHoverReload(true)} onMouseLeave={() => setHoverReload(false)}/> 154 | setHoverMin(true)} onMouseLeave={() => setHoverMin(false)}/> 155 | setHoverMax(true)} onMouseLeave={() => setHoverMax(false)}/> 156 | setHoverClose(true)} onMouseLeave={() => setHoverClose(false)}/> 157 |
    158 |
    159 |
    160 | ) 161 | } 162 | 163 | export default TitleBar 164 | -------------------------------------------------------------------------------- /components/VersionDialog.tsx: -------------------------------------------------------------------------------- 1 | import {ipcRenderer} from "electron" 2 | import {app} from "@electron/remote" 3 | import React, {useEffect, useState} from "react" 4 | import "../styles/versiondialog.less" 5 | 6 | const VersionDialog: React.FunctionComponent = (props) => { 7 | const [version, setVersion] = useState(app.getVersion()) 8 | const [newVersion, setNewVersion] = useState(false) 9 | const [visible, setVisible] = useState(false) 10 | 11 | useEffect(() => { 12 | const showVersionDialog = (event: any, update: any) => { 13 | setVisible((prev) => !prev) 14 | if (update) { 15 | setVersion(update) 16 | setNewVersion(true) 17 | } 18 | } 19 | const closeAllDialogs = (event: any, ignore: any) => { 20 | if (ignore !== "version") setVisible(false) 21 | } 22 | ipcRenderer.on("show-version-dialog", showVersionDialog) 23 | ipcRenderer.on("close-all-dialogs", closeAllDialogs) 24 | return () => { 25 | ipcRenderer.removeListener("show-version-dialog", showVersionDialog) 26 | ipcRenderer.removeListener("close-all-dialogs", closeAllDialogs) 27 | } 28 | }, []) 29 | 30 | const getText = () => { 31 | if (newVersion) { 32 | return `A new version (v${version}) is available! Would you like to download the update?` 33 | } else { 34 | return `No updates were found, you are currently on the latest version.` 35 | } 36 | } 37 | 38 | const click = (button: "accept" | "reject") => { 39 | if (newVersion && button === "accept") { 40 | ipcRenderer.invoke("install-update") 41 | } 42 | setVisible(false) 43 | } 44 | 45 | if (visible) { 46 | return ( 47 |
    48 |
    49 |
    50 |

    {getText()}

    51 |
    52 | 53 | 54 |
    55 |
    56 |
    57 |
    58 | ) 59 | } 60 | return null 61 | } 62 | 63 | export default VersionDialog 64 | -------------------------------------------------------------------------------- /declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.png" 2 | declare module "*.jpg" 3 | declare module "*.gif" 4 | declare module "*.mp3" 5 | declare module "*.wav" 6 | declare module "shade-blend-color" 7 | declare module "react-reorder" 8 | declare module "sharp-phash" 9 | declare module "sharp-phash/distance" 10 | declare module "image-pixels" 11 | declare module "bing-translate-api" 12 | declare module "mkv-subtitle-extractor" 13 | declare module "srt-to-vtt" 14 | declare module "ass-to-vtt" 15 | declare module "ass-to-srt" 16 | declare module "imagemin-pngquant" 17 | declare module "@react-pdf/pdfkit" 18 | declare module "images-meta" 19 | 20 | type OpenImageProps = { 21 | label: string 22 | image: { 23 | data: Blob 24 | pos: number 25 | palette: unknown[] 26 | imgData: Blob 27 | transparency: unknown 28 | text: unknown 29 | width: number 30 | height: number 31 | bits: number 32 | colorType: number 33 | compressionMethod: number 34 | interlaceMethod: number 35 | colors: number 36 | hasAlphaChannel: boolean 37 | pixelBitlength: number 38 | colorSpace: string 39 | } 40 | width: number 41 | height: number 42 | imgData: Blob 43 | obj: unknown 44 | } 45 | 46 | declare namespace PDFKit { 47 | interface PDFDocument { 48 | openImage(path: string): OpenImageProps 49 | } 50 | } -------------------------------------------------------------------------------- /dev-app-update.yml: -------------------------------------------------------------------------------- 1 | provider: github 2 | repo: Image-Compressor 3 | owner: Moebits 4 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Image Compressor 9 | 10 | 11 |
    12 | 13 | -------------------------------------------------------------------------------- /index.less: -------------------------------------------------------------------------------- 1 | @import "~rc-slider/assets/index.css"; 2 | 3 | @import url("https://fonts.googleapis.com/css2?family=Maven+Pro:wght@700&display=swap"); 4 | @import url("https://fonts.googleapis.com/css2?family=Yusei+Magic&display=swap"); 5 | @import url("https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap"); 6 | @import url("https://fonts.googleapis.com/css2?family=Skranji&display=swap"); 7 | 8 | :root { 9 | --selection-color: #ffb5cb; 10 | --bg-color: #e14952; 11 | --title-color: #f33b37; 12 | --text-color: black; 13 | --version-color: #ff3a5b; 14 | --version-text: black; 15 | --version-accept: #ff426b; 16 | --version-accept-text: black; 17 | --version-reject: #be3b57; 18 | --version-reject-text: black; 19 | } 20 | 21 | * { 22 | margin: 0; 23 | padding: 0; 24 | box-sizing: border-box; 25 | user-select: none; 26 | overflow-anchor: none; 27 | } 28 | 29 | html, body { 30 | background-color: var(--bg-color); 31 | overflow-x: hidden; 32 | overflow-y: hidden; 33 | height: 100%; 34 | width: 100%; 35 | } 36 | 37 | body { 38 | overflow-y: visible; 39 | } 40 | 41 | p { 42 | margin-bottom: 0; 43 | } 44 | 45 | @keyframes fadein { 46 | from { 47 | opacity: 0; 48 | } 49 | to { 50 | opacity: 1; 51 | } 52 | } 53 | 54 | .app { 55 | -webkit-app-region: no-drag; 56 | animation: fadein 0.5s; 57 | display: flex; 58 | flex-direction: column; 59 | overflow: visible; 60 | width: 100%; 61 | height: 100%; 62 | &:focus { 63 | outline: none; 64 | } 65 | } 66 | 67 | ::selection { 68 | background-color: var(--selection-color); 69 | color: white; 70 | } 71 | 72 | ::-webkit-scrollbar { 73 | width: 20px; 74 | } 75 | 76 | ::-webkit-scrollbar-track { 77 | background: #000000; 78 | } 79 | 80 | ::-webkit-scrollbar-thumb { 81 | background: #5a5a5a; 82 | } 83 | 84 | ::-webkit-scrollbar-thumb:hover { 85 | background: #303030; 86 | } 87 | 88 | input[type="search"]::-webkit-search-decoration, 89 | input[type="search"]::-webkit-search-cancel-button, 90 | input[type="search"]::-webkit-search-results-button, 91 | input[type="search"]::-webkit-search-results-decoration { display: none; } 92 | 93 | input::-webkit-outer-spin-button, 94 | input::-webkit-inner-spin-button { 95 | -webkit-appearance: none; 96 | margin: 0; 97 | } 98 | 99 | input:focus, button:focus, select:focus { 100 | outline: none; 101 | } 102 | 103 | img, p { 104 | -webkit-user-drag: none; 105 | } 106 | 107 | img { 108 | image-rendering: -webkit-optimize-contrast; 109 | } 110 | 111 | ul { 112 | list-style-type: none; 113 | } 114 | 115 | input[type="checkbox"] { 116 | appearance: none; 117 | border: none; 118 | height: 13px; 119 | width: 13px; 120 | font-size: 16px; 121 | position: relative; 122 | background: white; 123 | border-radius: 2px; 124 | &:checked::before { 125 | content: '\2713'; 126 | background: #ff3370; 127 | width: 100%; 128 | height: 100%; 129 | top: 0; 130 | left: 0; 131 | display: flex; 132 | align-items: center; 133 | justify-content: center; 134 | color: white; 135 | font-weight: bold; 136 | } 137 | } -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Attribution-NonCommercial 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-NonCommercial 4.0 International Public 58 | License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-NonCommercial 4.0 International Public License ("Public 63 | License"). To the extent this Public License may be interpreted as a 64 | contract, You are granted the Licensed Rights in consideration of Your 65 | acceptance of these terms and conditions, and the Licensor grants You 66 | such rights in consideration of benefits the Licensor receives from 67 | making the Licensed Material available under these terms and 68 | conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. Copyright and Similar Rights means copyright and/or similar rights 88 | closely related to copyright including, without limitation, 89 | performance, broadcast, sound recording, and Sui Generis Database 90 | Rights, without regard to how the rights are labeled or 91 | categorized. For purposes of this Public License, the rights 92 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 93 | Rights. 94 | d. Effective Technological Measures means those measures that, in the 95 | absence of proper authority, may not be circumvented under laws 96 | fulfilling obligations under Article 11 of the WIPO Copyright 97 | Treaty adopted on December 20, 1996, and/or similar international 98 | agreements. 99 | 100 | e. Exceptions and Limitations means fair use, fair dealing, and/or 101 | any other exception or limitation to Copyright and Similar Rights 102 | that applies to Your use of the Licensed Material. 103 | 104 | f. Licensed Material means the artistic or literary work, database, 105 | or other material to which the Licensor applied this Public 106 | License. 107 | 108 | g. Licensed Rights means the rights granted to You subject to the 109 | terms and conditions of this Public License, which are limited to 110 | all Copyright and Similar Rights that apply to Your use of the 111 | Licensed Material and that the Licensor has authority to license. 112 | 113 | h. Licensor means the individual(s) or entity(ies) granting rights 114 | under this Public License. 115 | 116 | i. NonCommercial means not primarily intended for or directed towards 117 | commercial advantage or monetary compensation. For purposes of 118 | this Public License, the exchange of the Licensed Material for 119 | other material subject to Copyright and Similar Rights by digital 120 | file-sharing or similar means is NonCommercial provided there is 121 | no payment of monetary compensation in connection with the 122 | exchange. 123 | 124 | j. Share means to provide material to the public by any means or 125 | process that requires permission under the Licensed Rights, such 126 | as reproduction, public display, public performance, distribution, 127 | dissemination, communication, or importation, and to make material 128 | available to the public including in ways that members of the 129 | public may access the material from a place and at a time 130 | individually chosen by them. 131 | 132 | k. Sui Generis Database Rights means rights other than copyright 133 | resulting from Directive 96/9/EC of the European Parliament and of 134 | the Council of 11 March 1996 on the legal protection of databases, 135 | as amended and/or succeeded, as well as other essentially 136 | equivalent rights anywhere in the world. 137 | 138 | l. You means the individual or entity exercising the Licensed Rights 139 | under this Public License. Your has a corresponding meaning. 140 | 141 | 142 | Section 2 -- Scope. 143 | 144 | a. License grant. 145 | 146 | 1. Subject to the terms and conditions of this Public License, 147 | the Licensor hereby grants You a worldwide, royalty-free, 148 | non-sublicensable, non-exclusive, irrevocable license to 149 | exercise the Licensed Rights in the Licensed Material to: 150 | 151 | a. reproduce and Share the Licensed Material, in whole or 152 | in part, for NonCommercial purposes only; and 153 | 154 | b. produce, reproduce, and Share Adapted Material for 155 | NonCommercial purposes only. 156 | 157 | 2. Exceptions and Limitations. For the avoidance of doubt, where 158 | Exceptions and Limitations apply to Your use, this Public 159 | License does not apply, and You do not need to comply with 160 | its terms and conditions. 161 | 162 | 3. Term. The term of this Public License is specified in Section 163 | 6(a). 164 | 165 | 4. Media and formats; technical modifications allowed. The 166 | Licensor authorizes You to exercise the Licensed Rights in 167 | all media and formats whether now known or hereafter created, 168 | and to make technical modifications necessary to do so. The 169 | Licensor waives and/or agrees not to assert any right or 170 | authority to forbid You from making technical modifications 171 | necessary to exercise the Licensed Rights, including 172 | technical modifications necessary to circumvent Effective 173 | Technological Measures. For purposes of this Public License, 174 | simply making modifications authorized by this Section 2(a) 175 | (4) never produces Adapted Material. 176 | 177 | 5. Downstream recipients. 178 | 179 | a. Offer from the Licensor -- Licensed Material. Every 180 | recipient of the Licensed Material automatically 181 | receives an offer from the Licensor to exercise the 182 | Licensed Rights under the terms and conditions of this 183 | Public License. 184 | 185 | b. No downstream restrictions. You may not offer or impose 186 | any additional or different terms or conditions on, or 187 | apply any Effective Technological Measures to, the 188 | Licensed Material if doing so restricts exercise of the 189 | Licensed Rights by any recipient of the Licensed 190 | Material. 191 | 192 | 6. No endorsement. Nothing in this Public License constitutes or 193 | may be construed as permission to assert or imply that You 194 | are, or that Your use of the Licensed Material is, connected 195 | with, or sponsored, endorsed, or granted official status by, 196 | the Licensor or others designated to receive attribution as 197 | provided in Section 3(a)(1)(A)(i). 198 | 199 | b. Other rights. 200 | 201 | 1. Moral rights, such as the right of integrity, are not 202 | licensed under this Public License, nor are publicity, 203 | privacy, and/or other similar personality rights; however, to 204 | the extent possible, the Licensor waives and/or agrees not to 205 | assert any such rights held by the Licensor to the limited 206 | extent necessary to allow You to exercise the Licensed 207 | Rights, but not otherwise. 208 | 209 | 2. Patent and trademark rights are not licensed under this 210 | Public License. 211 | 212 | 3. To the extent possible, the Licensor waives any right to 213 | collect royalties from You for the exercise of the Licensed 214 | Rights, whether directly or through a collecting society 215 | under any voluntary or waivable statutory or compulsory 216 | licensing scheme. In all other cases the Licensor expressly 217 | reserves any right to collect such royalties, including when 218 | the Licensed Material is used other than for NonCommercial 219 | purposes. 220 | 221 | 222 | Section 3 -- License Conditions. 223 | 224 | Your exercise of the Licensed Rights is expressly made subject to the 225 | following conditions. 226 | 227 | a. Attribution. 228 | 229 | 1. If You Share the Licensed Material (including in modified 230 | form), You must: 231 | 232 | a. retain the following if it is supplied by the Licensor 233 | with the Licensed Material: 234 | 235 | i. identification of the creator(s) of the Licensed 236 | Material and any others designated to receive 237 | attribution, in any reasonable manner requested by 238 | the Licensor (including by pseudonym if 239 | designated); 240 | 241 | ii. a copyright notice; 242 | 243 | iii. a notice that refers to this Public License; 244 | 245 | iv. a notice that refers to the disclaimer of 246 | warranties; 247 | 248 | v. a URI or hyperlink to the Licensed Material to the 249 | extent reasonably practicable; 250 | 251 | b. indicate if You modified the Licensed Material and 252 | retain an indication of any previous modifications; and 253 | 254 | c. indicate the Licensed Material is licensed under this 255 | Public License, and include the text of, or the URI or 256 | hyperlink to, this Public License. 257 | 258 | 2. You may satisfy the conditions in Section 3(a)(1) in any 259 | reasonable manner based on the medium, means, and context in 260 | which You Share the Licensed Material. For example, it may be 261 | reasonable to satisfy the conditions by providing a URI or 262 | hyperlink to a resource that includes the required 263 | information. 264 | 265 | 3. If requested by the Licensor, You must remove any of the 266 | information required by Section 3(a)(1)(A) to the extent 267 | reasonably practicable. 268 | 269 | 4. If You Share Adapted Material You produce, the Adapter's 270 | License You apply must not prevent recipients of the Adapted 271 | Material from complying with this Public License. 272 | 273 | 274 | Section 4 -- Sui Generis Database Rights. 275 | 276 | Where the Licensed Rights include Sui Generis Database Rights that 277 | apply to Your use of the Licensed Material: 278 | 279 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 280 | to extract, reuse, reproduce, and Share all or a substantial 281 | portion of the contents of the database for NonCommercial purposes 282 | only; 283 | 284 | b. if You include all or a substantial portion of the database 285 | contents in a database in which You have Sui Generis Database 286 | Rights, then the database in which You have Sui Generis Database 287 | Rights (but not its individual contents) is Adapted Material; and 288 | 289 | c. You must comply with the conditions in Section 3(a) if You Share 290 | all or a substantial portion of the contents of the database. 291 | 292 | For the avoidance of doubt, this Section 4 supplements and does not 293 | replace Your obligations under this Public License where the Licensed 294 | Rights include other Copyright and Similar Rights. 295 | 296 | 297 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 298 | 299 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 300 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 301 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 302 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 303 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 304 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 305 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 306 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 307 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 308 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 309 | 310 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 311 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 312 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 313 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 314 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 315 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 316 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 317 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 318 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 319 | 320 | c. The disclaimer of warranties and limitation of liability provided 321 | above shall be interpreted in a manner that, to the extent 322 | possible, most closely approximates an absolute disclaimer and 323 | waiver of all liability. 324 | 325 | 326 | Section 6 -- Term and Termination. 327 | 328 | a. This Public License applies for the term of the Copyright and 329 | Similar Rights licensed here. However, if You fail to comply with 330 | this Public License, then Your rights under this Public License 331 | terminate automatically. 332 | 333 | b. Where Your right to use the Licensed Material has terminated under 334 | Section 6(a), it reinstates: 335 | 336 | 1. automatically as of the date the violation is cured, provided 337 | it is cured within 30 days of Your discovery of the 338 | violation; or 339 | 340 | 2. upon express reinstatement by the Licensor. 341 | 342 | For the avoidance of doubt, this Section 6(b) does not affect any 343 | right the Licensor may have to seek remedies for Your violations 344 | of this Public License. 345 | 346 | c. For the avoidance of doubt, the Licensor may also offer the 347 | Licensed Material under separate terms or conditions or stop 348 | distributing the Licensed Material at any time; however, doing so 349 | will not terminate this Public License. 350 | 351 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 352 | License. 353 | 354 | 355 | Section 7 -- Other Terms and Conditions. 356 | 357 | a. The Licensor shall not be bound by any additional or different 358 | terms or conditions communicated by You unless expressly agreed. 359 | 360 | b. Any arrangements, understandings, or agreements regarding the 361 | Licensed Material not stated herein are separate from and 362 | independent of the terms and conditions of this Public License. 363 | 364 | 365 | Section 8 -- Interpretation. 366 | 367 | a. For the avoidance of doubt, this Public License does not, and 368 | shall not be interpreted to, reduce, limit, restrict, or impose 369 | conditions on any use of the Licensed Material that could lawfully 370 | be made without permission under this Public License. 371 | 372 | b. To the extent possible, if any provision of this Public License is 373 | deemed unenforceable, it shall be automatically reformed to the 374 | minimum extent necessary to make it enforceable. If the provision 375 | cannot be reformed, it shall be severed from this Public License 376 | without affecting the enforceability of the remaining terms and 377 | conditions. 378 | 379 | c. No term or condition of this Public License will be waived and no 380 | failure to comply consented to unless expressly agreed to by the 381 | Licensor. 382 | 383 | d. Nothing in this Public License constitutes or may be interpreted 384 | as a limitation upon, or waiver of, any privileges and immunities 385 | that apply to the Licensor or You, including from the legal 386 | processes of any jurisdiction or authority. 387 | 388 | ======================================================================= 389 | 390 | Creative Commons is not a party to its public 391 | licenses. Notwithstanding, Creative Commons may elect to apply one of 392 | its public licenses to material it publishes and in those instances 393 | will be considered the “Licensor.” The text of the Creative Commons 394 | public licenses is dedicated to the public domain under the CC0 Public 395 | Domain Dedication. Except for the limited purpose of indicating that 396 | material is shared under a Creative Commons public license or as 397 | otherwise permitted by the Creative Commons policies published at 398 | creativecommons.org/policies, Creative Commons does not authorize the 399 | use of the trademark "Creative Commons" or any other trademark or logo 400 | of Creative Commons without its prior written consent including, 401 | without limitation, in connection with any unauthorized modifications 402 | to any of its public licenses or any other arrangements, 403 | understandings, or agreements concerning use of licensed material. For 404 | the avoidance of doubt, this paragraph does not form part of the 405 | public licenses. 406 | 407 | Creative Commons may be contacted at creativecommons.org. 408 | 409 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "image-compressor", 3 | "version": "0.2.3", 4 | "description": "Compresses, resizes, and renames images.", 5 | "main": "dist/main.js", 6 | "scripts": { 7 | "start": "npm run clean && webpack && cross-env DEVELOPMENT=true electron dist/main.js", 8 | "clean": "del-cli ./dist", 9 | "build": "npm run clean ./build && webpack && cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder -m -p never", 10 | "rebuild": "npm rebuild --runtime=electron --target=14.0.0 --disturl=https://atom.io/download/atom-shell --abi=83", 11 | "release": "npm run release:mac && npm run release:win", 12 | "release:mac": "npm run clean ./build && webpack && npm run sharp:mac && cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder -m -p always", 13 | "release:win": "npm run clean ./build && webpack && npm run sharp:win && cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder -w -p always", 14 | "sharp:mac": "del-cli ./node_modules/sharp && npm install --platform=darwin --arch=arm64 sharp", 15 | "sharp:win": "del-cli ./node_modules/sharp && npm install --platform=win32 --arch=x64 sharp" 16 | }, 17 | "overrides": { 18 | "graceful-fs": "^4.2.11" 19 | }, 20 | "keywords": [ 21 | "image", 22 | "compressor", 23 | "resizer", 24 | "renamer", 25 | "anime" 26 | ], 27 | "repository": { 28 | "type": "git", 29 | "url": "https://github.com/Moebits/Image-Compressor" 30 | }, 31 | "build": { 32 | "appId": "com.moebits.image-compressor", 33 | "productName": "Image Compressor", 34 | "icon": "./assets/icon.png", 35 | "directories": { 36 | "buildResources": "assets", 37 | "output": "build" 38 | }, 39 | "buildDependenciesFromSource": true, 40 | "mac": { 41 | "target": { 42 | "target": "dmg", 43 | "arch": "arm64" 44 | }, 45 | "category": "public.app-category.utilities", 46 | "extraFiles": [ 47 | "poppler/mac/**" 48 | ], 49 | "extraResources": [ 50 | { 51 | "from": "vendor/cjpeg", 52 | "to": "app/vendor/cjpeg" 53 | }, 54 | { 55 | "from": "vendor/cwebp", 56 | "to": "app/vendor/cwebp" 57 | }, 58 | { 59 | "from": "vendor/gifsicle", 60 | "to": "app/vendor/gifsicle" 61 | }, 62 | { 63 | "from": "vendor/pngquant", 64 | "to": "app/vendor/pngquant" 65 | } 66 | ] 67 | }, 68 | "dmg": { 69 | "title": "${productName}", 70 | "background": "./assets/background.png", 71 | "window": { 72 | "width": 540, 73 | "height": 380 74 | } 75 | }, 76 | "win": { 77 | "target": { 78 | "target": "nsis", 79 | "arch": "x64" 80 | }, 81 | "extraFiles": [ 82 | "poppler/windows/**" 83 | ], 84 | "files": [ 85 | "vendor/cjpeg.exe", 86 | "vendor/cwebp.exe", 87 | "vendor/gifsicle.exe", 88 | "vendor/pngquant.exe" 89 | ] 90 | }, 91 | "nsis": { 92 | "oneClick": false, 93 | "perMachine": true, 94 | "allowToChangeInstallationDirectory": true, 95 | "uninstallDisplayName": "Image Compressor", 96 | "createDesktopShortcut": "always", 97 | "installerSidebar": "./assets/installer.bmp", 98 | "uninstallerSidebar": "./assets/installer.bmp" 99 | }, 100 | "files": [ 101 | "dist/**/*", 102 | "package.json" 103 | ], 104 | "asar": true, 105 | "asarUnpack": [ 106 | "node_modules/**/*.node" 107 | ], 108 | "publish": { 109 | "provider": "github", 110 | "repo": "Image-Compressor", 111 | "owner": "Moebits", 112 | "releaseType": "draft" 113 | } 114 | }, 115 | "author": "Moebits", 116 | "license": "MIT", 117 | "devDependencies": { 118 | "@types/gif-encoder": "^0.7.1", 119 | "@types/imagemin": "^8.0.0", 120 | "@types/imagemin-gifsicle": "^7.0.1", 121 | "@types/imagemin-mozjpeg": "^8.0.1", 122 | "@types/imagemin-optipng": "^5.2.1", 123 | "@types/imagemin-webp": "^5.1.2", 124 | "@types/pdf-image": "^2.0.1", 125 | "@types/pdfkit": "^0.12.6", 126 | "@types/react": "^17.0.0", 127 | "@types/react-dom": "^17.0.0", 128 | "@types/sharp": "^0.29.3", 129 | "cross-env": "^7.0.3", 130 | "css-loader": "^5.0.1", 131 | "del-cli": "^3.0.1", 132 | "electron": "^28.2.1", 133 | "electron-builder": "^23.0.3", 134 | "file-loader": "^6.2.0", 135 | "fork-ts-checker-webpack-plugin": "^6.1.0", 136 | "html-loader": "^1.3.2", 137 | "html-webpack-plugin": "^5.6.0", 138 | "less": "^4.1.0", 139 | "less-loader": "^7.3.0", 140 | "mini-css-extract-plugin": "^1.3.5", 141 | "node-addon-api": "^8.1.0", 142 | "node-gyp": "^10.2.0", 143 | "node-loader": "^1.0.2", 144 | "raw-loader": "^4.0.2", 145 | "terser-webpack-plugin": "^5.1.1", 146 | "transform-loader": "^0.2.4", 147 | "ts-loader": "^9.2.6", 148 | "typescript": "^4.4.4", 149 | "wasm-loader": "^1.3.0", 150 | "webpack": "^5.18.0", 151 | "webpack-cli": "^4.4.0", 152 | "worker-loader": "^3.0.8" 153 | }, 154 | "dependencies": { 155 | "@electron/remote": "^2.1.2", 156 | "@react-pdf/pdfkit": "^3.1.2", 157 | "ass-to-srt": "^1.2.1", 158 | "ass-to-vtt": "^1.2.0", 159 | "bing-translate-api": "^2.2.1", 160 | "bootstrap": "^4.6.0", 161 | "electron-shortcuts": "^0.4.0", 162 | "electron-store": "^7.0.1", 163 | "electron-updater": "^4.3.5", 164 | "gif-encoder": "^0.7.2", 165 | "gif-frames": "github:benwiley4000/gif-frames", 166 | "image-pixels": "^2.2.2", 167 | "image-size": "^0.9.3", 168 | "imagemin": "github:moebits/imagemin#fix2", 169 | "imagemin-gifsicle": "^7.0.0", 170 | "imagemin-mozjpeg": "^10.0.0", 171 | "imagemin-pngquant": "^9.0.2", 172 | "imagemin-webp": "^8.0.0", 173 | "images-meta": "github:Moebits/images-meta", 174 | "mkv-subtitle-extractor": "^1.1.1", 175 | "rc-slider": "^9.7.4", 176 | "react": "^18.2.0", 177 | "react-bootstrap": "^1.4.3", 178 | "react-compare-slider": "^3.0.1", 179 | "react-dom": "^18.2.0", 180 | "react-dropzone": "^11.4.2", 181 | "react-reorder": "^3.0.0-alpha.7", 182 | "react-zoom-pan-pinch": "^3.4.0", 183 | "sagiri": "^3.1.1", 184 | "shade-blend-color": "^1.0.0", 185 | "sharp": "^0.33.5", 186 | "sharp-phash": "^2.0.0", 187 | "spawn-sync": "^2.0.0", 188 | "srt-to-vtt": "^1.1.3" 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /patch/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/.DS_Store -------------------------------------------------------------------------------- /patch/cwebp-bin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/cwebp-bin/.DS_Store -------------------------------------------------------------------------------- /patch/cwebp-bin/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import process from 'node:process'; 3 | import {spawn} from 'node:child_process'; 4 | import binPath from './index.js'; 5 | 6 | spawn(binPath, process.argv.slice(2), {stdio: 'inherit'}) 7 | .on('exit', process.exit); 8 | -------------------------------------------------------------------------------- /patch/cwebp-bin/index.js: -------------------------------------------------------------------------------- 1 | import lib from './lib/index.js'; 2 | 3 | export default lib.path(); 4 | -------------------------------------------------------------------------------- /patch/cwebp-bin/lib/index.js: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs'; 2 | import path from 'node:path'; 3 | import process from 'node:process'; 4 | import {fileURLToPath} from 'node:url'; 5 | import BinWrapper from 'bin-wrapper'; 6 | 7 | const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url))); 8 | const url = `https://raw.githubusercontent.com/imagemin/cwebp-bin/v${pkg.version}/vendor/`; 9 | 10 | const binWrapper = new BinWrapper() 11 | .src(`${url}osx/cwebp`, 'darwin') 12 | .src(`${url}linux/x86/cwebp`, 'linux', 'x86') 13 | .src(`${url}linux/x64/cwebp`, 'linux', 'x64') 14 | .src(`${url}win/x64/cwebp.exe`, 'win32', 'x64') 15 | .dest(path.resolve(__dirname, '../vendor')) 16 | .use(process.platform === 'win32' ? 'cwebp.exe' : 'cwebp'); 17 | 18 | export default binWrapper; 19 | -------------------------------------------------------------------------------- /patch/cwebp-bin/lib/install.js: -------------------------------------------------------------------------------- 1 | import process from 'node:process'; 2 | import {fileURLToPath} from 'node:url'; 3 | import binBuild from 'bin-build'; 4 | import bin from './index.js'; 5 | 6 | bin.run(['-version']).then(() => { 7 | console.log('cwebp pre-build test passed successfully'); 8 | }).catch(error => { 9 | console.warn(error.message); 10 | console.warn('cwebp pre-build test failed'); 11 | console.info('compiling from source'); 12 | 13 | try { 14 | const source = fileURLToPath(new URL('../vendor/source/libwebp-1.2.1.tar.gz', import.meta.url)); 15 | 16 | binBuild.file(source, [ 17 | `./configure --disable-shared --prefix="${bin.dest()}" --bindir="${bin.dest()}"`, 18 | 'make && make install', 19 | ]); 20 | 21 | console.log('cwebp built successfully'); 22 | } catch (error) { 23 | console.error(error.stack); 24 | 25 | // eslint-disable-next-line unicorn/no-process-exit 26 | process.exit(1); 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /patch/cwebp-bin/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Imagemin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /patch/cwebp-bin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cwebp-bin", 3 | "version": "8.0.0", 4 | "description": "cwebp wrapper that makes it seamlessly available as a local dependency", 5 | "license": "MIT", 6 | "repository": "imagemin/cwebp-bin", 7 | "type": "module", 8 | "exports": "./index.js", 9 | "funding": "https://github.com/imagemin/cwebp-bin?sponsor=1", 10 | "bin": { 11 | "cwebp": "cli.js" 12 | }, 13 | "engines": { 14 | "node": "^14.13.1 || >=16.0.0" 15 | }, 16 | "scripts": { 17 | "postinstall": "node lib/install.js", 18 | "test": "xo && ava --timeout=180s" 19 | }, 20 | "files": [ 21 | "cli.js", 22 | "index.js", 23 | "lib", 24 | "vendor/source" 25 | ], 26 | "keywords": [ 27 | "imagemin", 28 | "compress", 29 | "image", 30 | "img", 31 | "jpeg", 32 | "jpg", 33 | "minify", 34 | "optimize", 35 | "png", 36 | "webp" 37 | ], 38 | "dependencies": { 39 | "bin-build": "^3.0.0", 40 | "bin-wrapper": "^4.0.1" 41 | }, 42 | "devDependencies": { 43 | "ava": "^4.2.0", 44 | "bin-check": "^4.1.0", 45 | "compare-size": "^3.0.0", 46 | "execa": "^6.1.0", 47 | "tempy": "^3.0.0", 48 | "xo": "^0.48.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /patch/cwebp-bin/readme.md: -------------------------------------------------------------------------------- 1 | # cwebp-bin ![GitHub Actions Status](https://github.com/imagemin/cwebp-bin/workflows/test/badge.svg?branch=main) 2 | 3 | > [WebP](https://developers.google.com/speed/webp/) is a new image format that provides lossless and lossy compression for images on the web. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at equivalent SSIM index. 4 | 5 | You probably want [`imagemin-webp`](https://github.com/imagemin/imagemin-webp) instead. 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install cwebp-bin 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | import {execFile} from 'node:child_process'; 19 | import cwebp from 'cwebp-bin'; 20 | 21 | execFile(cwebp, ['input.png', '-o', 'output.webp'], err => { 22 | if (err) { 23 | throw err; 24 | } 25 | 26 | console.log('Image is converted!'); 27 | }); 28 | ``` 29 | 30 | 31 | ## CLI 32 | 33 | ``` 34 | $ npm install --global cwebp-bin 35 | ``` 36 | 37 | ``` 38 | $ cwebp --help 39 | ``` 40 | 41 | 42 | ## License 43 | 44 | MIT © [Imagemin](https://github.com/imagemin) 45 | -------------------------------------------------------------------------------- /patch/cwebp-bin/vendor/cwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/cwebp-bin/vendor/cwebp -------------------------------------------------------------------------------- /patch/cwebp-bin/vendor/source/libwebp-1.2.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/cwebp-bin/vendor/source/libwebp-1.2.1.tar.gz -------------------------------------------------------------------------------- /patch/mozjpeg/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/mozjpeg/.DS_Store -------------------------------------------------------------------------------- /patch/mozjpeg/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import {spawn} from 'node:child_process'; 3 | import process from 'node:process'; 4 | import mozjpeg from './index.js'; 5 | 6 | const input = process.argv.slice(2); 7 | 8 | spawn(mozjpeg, input, {stdio: 'inherit'}) 9 | .on('exit', process.exit); 10 | -------------------------------------------------------------------------------- /patch/mozjpeg/index.js: -------------------------------------------------------------------------------- 1 | import lib from './lib/index.js'; 2 | 3 | export default lib.path(); 4 | -------------------------------------------------------------------------------- /patch/mozjpeg/lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/mozjpeg/lib/.DS_Store -------------------------------------------------------------------------------- /patch/mozjpeg/lib/index.js: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs'; 2 | import path from 'node:path'; 3 | import process from 'node:process'; 4 | import {fileURLToPath} from 'node:url'; 5 | import BinWrapper from 'bin-wrapper'; 6 | 7 | const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url))); 8 | const url = `https://raw.githubusercontent.com/imagemin/mozjpeg-bin/v${pkg.version}/vendor/`; 9 | 10 | const binWrapper = new BinWrapper() 11 | .src(`${url}macos/cjpeg`, 'darwin') 12 | .src(`${url}linux/cjpeg`, 'linux') 13 | .src(`${url}win/cjpeg.exe`, 'win32') 14 | .dest(path.resolve(__dirname, '../vendor')) 15 | .use(process.platform === 'win32' ? 'cjpeg.exe' : 'cjpeg'); 16 | 17 | export default binWrapper; 18 | -------------------------------------------------------------------------------- /patch/mozjpeg/lib/install.js: -------------------------------------------------------------------------------- 1 | import os from 'node:os'; 2 | import process from 'node:process'; 3 | import {fileURLToPath} from 'node:url'; 4 | import binBuild from 'bin-build'; 5 | import bin from './index.js'; 6 | 7 | const cpuNumber = Math.max(os.cpus().length, 1); 8 | 9 | bin.run(['-version']).then(() => { 10 | console.log('mozjpeg pre-build test passed successfully'); 11 | }).catch(async error => { 12 | console.warn(error.message); 13 | console.warn('mozjpeg pre-build test failed'); 14 | console.info('compiling from source'); 15 | 16 | let cfgExtras = ''; 17 | if (process.platform === 'darwin') { 18 | cfgExtras = 'libpng_LIBS=\'/usr/local/lib/libpng16.a -lz\' --enable-static'; 19 | } 20 | 21 | const cfg = [ 22 | `./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8 ${cfgExtras}`, 23 | `--prefix="${bin.dest()}" --bindir="${bin.dest()}" --libdir="${bin.dest()}"`, 24 | ].join(' '); 25 | 26 | try { 27 | const source = fileURLToPath(new URL('../vendor/source/mozjpeg.tar.gz', import.meta.url)); 28 | await binBuild.file(source, [ 29 | 'autoreconf -fiv', 30 | cfg, 31 | `make -j${cpuNumber}`, 32 | `make install -j${cpuNumber}`, 33 | ]); 34 | 35 | console.log('mozjpeg built successfully'); 36 | } catch (error) { 37 | console.error(error.stack); 38 | 39 | // eslint-disable-next-line unicorn/no-process-exit 40 | process.exit(1); 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /patch/mozjpeg/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Imagemin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /patch/mozjpeg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mozjpeg", 3 | "version": "8.0.0", 4 | "description": "mozjpeg wrapper that makes it seamlessly available as a local dependency", 5 | "license": "MIT", 6 | "repository": "imagemin/mozjpeg-bin", 7 | "type": "module", 8 | "exports": "./index.js", 9 | "bin": "cli.js", 10 | "engines": { 11 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" 12 | }, 13 | "scripts": { 14 | "postinstall": "node lib/install.js", 15 | "test": "xo && ava --timeout=120s", 16 | "build-linux": "docker build --tag imagemin/mozjpeg docker && docker run --rm --volume $(pwd)/vendor/linux:/src/out imagemin/mozjpeg cp cjpeg /src/out" 17 | }, 18 | "files": [ 19 | "index.js", 20 | "cli.js", 21 | "lib", 22 | "vendor/source" 23 | ], 24 | "keywords": [ 25 | "imagemin", 26 | "jpeg", 27 | "jpg", 28 | "img", 29 | "image", 30 | "compress", 31 | "minify", 32 | "mozjpeg", 33 | "optimize" 34 | ], 35 | "dependencies": { 36 | "bin-build": "^3.0.0", 37 | "bin-wrapper": "^4.0.0" 38 | }, 39 | "devDependencies": { 40 | "ava": "^3.8.0", 41 | "bin-check": "^4.1.0", 42 | "compare-size": "^3.0.0", 43 | "execa": "^5.1.1", 44 | "tempy": "^2.0.0", 45 | "xo": "^0.45.0" 46 | }, 47 | "ava": { 48 | "serial": true 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /patch/mozjpeg/readme.md: -------------------------------------------------------------------------------- 1 | # mozjpeg-bin ![GitHub Actions Status](https://github.com/imagemin/mozjpeg-bin/workflows/test/badge.svg?branch=main) 2 | 3 | > [mozjpeg](https://github.com/mozilla/mozjpeg) is a production-quality JPEG encoder that improves compression while maintaining compatibility with the vast majority of deployed decoders 4 | 5 | You probably want [`imagemin-mozjpeg`](https://github.com/imagemin/imagemin-mozjpeg) instead. 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install mozjpeg 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | import {execFile} from 'node:child_process'; 19 | import mozjpeg from 'mozjpeg'; 20 | 21 | execFile(mozjpeg, ['-outfile', 'output.jpg', 'input.jpg'], err => { 22 | console.log('Image minified!'); 23 | }); 24 | ``` 25 | 26 | 27 | ## CLI 28 | 29 | ``` 30 | $ npm install --global mozjpeg 31 | ``` 32 | 33 | ``` 34 | $ mozjpeg --help 35 | ``` 36 | 37 | 38 | ## License 39 | 40 | MIT © [Imagemin](https://github.com/imagemin) 41 | -------------------------------------------------------------------------------- /patch/mozjpeg/vendor/cjpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/mozjpeg/vendor/cjpeg -------------------------------------------------------------------------------- /patch/mozjpeg/vendor/source/mozjpeg.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/patch/mozjpeg/vendor/source/mozjpeg.tar.gz -------------------------------------------------------------------------------- /poppler/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/.DS_Store -------------------------------------------------------------------------------- /poppler/mac/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/.DS_Store -------------------------------------------------------------------------------- /poppler/mac/bin/pdfattach: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdfattach -------------------------------------------------------------------------------- /poppler/mac/bin/pdfdetach: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdfdetach -------------------------------------------------------------------------------- /poppler/mac/bin/pdffonts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdffonts -------------------------------------------------------------------------------- /poppler/mac/bin/pdfimages: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdfimages -------------------------------------------------------------------------------- /poppler/mac/bin/pdfinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdfinfo -------------------------------------------------------------------------------- /poppler/mac/bin/pdfseparate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdfseparate -------------------------------------------------------------------------------- /poppler/mac/bin/pdfsig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdfsig -------------------------------------------------------------------------------- /poppler/mac/bin/pdftocairo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdftocairo -------------------------------------------------------------------------------- /poppler/mac/bin/pdftohtml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdftohtml -------------------------------------------------------------------------------- /poppler/mac/bin/pdftoppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdftoppm -------------------------------------------------------------------------------- /poppler/mac/bin/pdftops: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdftops -------------------------------------------------------------------------------- /poppler/mac/bin/pdftotext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdftotext -------------------------------------------------------------------------------- /poppler/mac/bin/pdfunite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pdfunite -------------------------------------------------------------------------------- /poppler/mac/bin/pnmtojpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/bin/pnmtojpeg -------------------------------------------------------------------------------- /poppler/mac/lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/lib/.DS_Store -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-cpp.0.10.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/lib/libpoppler-cpp.0.10.0.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-cpp.0.dylib: -------------------------------------------------------------------------------- 1 | libpoppler-cpp.0.10.0.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-cpp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/lib/libpoppler-cpp.a -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-cpp.dylib: -------------------------------------------------------------------------------- 1 | libpoppler-cpp.0.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-glib.8.23.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/lib/libpoppler-glib.8.23.0.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-glib.8.dylib: -------------------------------------------------------------------------------- 1 | libpoppler-glib.8.23.0.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-glib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/lib/libpoppler-glib.a -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler-glib.dylib: -------------------------------------------------------------------------------- 1 | libpoppler-glib.8.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler.122.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/lib/libpoppler.122.0.0.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler.122.dylib: -------------------------------------------------------------------------------- 1 | libpoppler.122.0.0.dylib -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/mac/lib/libpoppler.a -------------------------------------------------------------------------------- /poppler/mac/lib/libpoppler.dylib: -------------------------------------------------------------------------------- 1 | libpoppler.122.dylib -------------------------------------------------------------------------------- /poppler/windows/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/.DS_Store -------------------------------------------------------------------------------- /poppler/windows/bin/freetype6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/freetype6.dll -------------------------------------------------------------------------------- /poppler/windows/bin/jpeg62.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/jpeg62.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libcairo-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libcairo-2.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libexpat-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libexpat-1.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libfontconfig-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libfontconfig-1.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libgcc_s_dw2-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libgcc_s_dw2-1.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libpixman-1-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libpixman-1-0.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libpng16-16.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libpng16-16.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libpoppler-79.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libpoppler-79.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libpoppler-cpp-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libpoppler-cpp-0.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libstdc++-6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libstdc++-6.dll -------------------------------------------------------------------------------- /poppler/windows/bin/libtiff3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/libtiff3.dll -------------------------------------------------------------------------------- /poppler/windows/bin/pdfdetach.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdfdetach.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdffonts.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdffonts.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdfimages.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdfimages.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdfinfo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdfinfo.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdfseparate.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdfseparate.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdftocairo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdftocairo.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdftohtml.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdftohtml.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdftoppm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdftoppm.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdftops.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdftops.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdftotext.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdftotext.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pdfunite.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pdfunite.exe -------------------------------------------------------------------------------- /poppler/windows/bin/pnmtojpeg.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/pnmtojpeg.exe -------------------------------------------------------------------------------- /poppler/windows/bin/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/bin/zlib1.dll -------------------------------------------------------------------------------- /poppler/windows/lib/libpoppler-cpp.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/lib/libpoppler-cpp.dll.a -------------------------------------------------------------------------------- /poppler/windows/lib/libpoppler.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/poppler/windows/lib/libpoppler.dll.a -------------------------------------------------------------------------------- /preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Image Compressor 8 | 9 | 10 |
    11 | 12 | -------------------------------------------------------------------------------- /preview.less: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Maven+Pro&display=swap"); 2 | @import url("https://fonts.googleapis.com/css2?family=Yusei+Magic&display=swap"); 3 | @import url("https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap"); 4 | @import url("https://fonts.googleapis.com/css2?family=Skranji&display=swap"); 5 | 6 | @title-bar-height: 30px; 7 | 8 | * { 9 | margin: 0; 10 | padding: 0; 11 | box-sizing: border-box; 12 | user-select: none; 13 | } 14 | 15 | html, body { 16 | width: 100%; 17 | height: 100%; 18 | background: repeating-conic-gradient(#131313 0% 25%, #181818 0% 50%) 50% / 10px 10px 19 | } 20 | 21 | #root { 22 | width: 100%; 23 | height: 100%; 24 | } 25 | 26 | .app { 27 | width: 100%; 28 | height: 100%; 29 | } 30 | 31 | #webview { 32 | width: 100%; 33 | height: 100%; 34 | padding-top: @title-bar-height; 35 | } 36 | 37 | ::selection { 38 | background-color: #ffb5cb; 39 | color: white; 40 | } 41 | 42 | ::-webkit-scrollbar { 43 | width: 20px; 44 | } 45 | 46 | ::-webkit-scrollbar-track { 47 | background: #000000; 48 | } 49 | 50 | ::-webkit-scrollbar-thumb { 51 | background: #5a5a5a; 52 | } 53 | 54 | ::-webkit-scrollbar-thumb:hover { 55 | background: #303030; 56 | } 57 | 58 | .preview-container { 59 | display: flex; 60 | justify-content: center; 61 | align-items: center; 62 | width: 100%; 63 | height: calc(100vh - @title-bar-height); 64 | position: absolute; 65 | bottom: 0; 66 | } 67 | 68 | .preview { 69 | width: max-content; 70 | height: max-content; 71 | } 72 | 73 | .image { 74 | width: auto; 75 | height: auto; 76 | max-width: calc(100vw - 120px); 77 | max-height: calc(100vh - @title-bar-height * 2); 78 | } 79 | 80 | .react-transform-wrapper { 81 | width: 100% !important; 82 | height: 100% !important; 83 | } 84 | 85 | .react-transform-component { 86 | width: 100% !important; 87 | height: 100% !important; 88 | } 89 | 90 | .preview-text { 91 | margin-right: 10px; 92 | width: 100px; 93 | color: #f55195; 94 | font-size: 15px; 95 | font-family: "Maven Pro", sans-serif; 96 | position: absolute; 97 | right: 0; 98 | bottom: 2%; 99 | text-shadow: 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black,0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black,0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black,0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black; 100 | } 101 | 102 | .preview-text2 { 103 | margin-left: 10px; 104 | width: 100px; 105 | color: #f55195; 106 | font-size: 15px; 107 | font-family: "Maven Pro", sans-serif; 108 | position: absolute; 109 | left: 0; 110 | bottom: 2%; 111 | text-shadow: 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black,0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black,0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black,0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black, 0 0 1px black; 112 | } -------------------------------------------------------------------------------- /preview.tsx: -------------------------------------------------------------------------------- 1 | import {ipcRenderer} from "electron" 2 | import React, {useState, useEffect, useRef} from "react" 3 | import ReactDom from "react-dom" 4 | import PreviewTitleBar from "./components/PreviewTitleBar" 5 | import {TransformWrapper, TransformComponent} from "react-zoom-pan-pinch" 6 | import {ReactCompareSlider, ReactCompareSliderHandle} from "react-compare-slider" 7 | import functions from "./structures/functions" 8 | import "./preview.less" 9 | 10 | const App: React.FunctionComponent = () => { 11 | const [oldImage, setOldImage] = useState("") 12 | const [oldFileSize, setOldFileSize] = useState("0") 13 | const [newImage, setNewImage] = useState("") 14 | const [newFileSize, setNewFileSize] = useState("0") 15 | const [zoomScale, setZoomScale] = useState(1) 16 | const [id, setID] = useState(0) 17 | const [title, setTitle] = useState("") 18 | const [position, setPosition] = useState(50) 19 | const zoomRef = useRef(null) as any 20 | 21 | useEffect(() => { 22 | const updateBuffer = (event: any, info: {id: number, title: string, source: string, fileSize: string, newSource: string, newFileSize: string}) => { 23 | setOldImage(info.source) 24 | setOldFileSize(info.fileSize) 25 | setID(info.id) 26 | setTitle(info.title) 27 | resetZoom() 28 | if (!info.newFileSize || !parseInt(info.newFileSize)) { 29 | setNewImage(info.source) 30 | setNewFileSize(info.fileSize) 31 | } else { 32 | setNewImage(info.newSource) 33 | setNewFileSize(info.newFileSize) 34 | } 35 | } 36 | ipcRenderer.on("update-buffer", updateBuffer) 37 | ipcRenderer.on("zoom-in", zoomIn) 38 | ipcRenderer.on("zoom-out", zoomOut) 39 | return () => { 40 | ipcRenderer.removeListener("update-buffer", updateBuffer) 41 | ipcRenderer.removeListener("zoom-in", zoomIn) 42 | ipcRenderer.removeListener("zoom-out", zoomOut) 43 | } 44 | }, []) 45 | 46 | useEffect(() => { 47 | const updateBufferRealtime = (event: any, info: {id: number, newSource: string, newFileSize: string}) => { 48 | if (id === info.id) { 49 | setNewImage(info.newSource) 50 | setNewFileSize(info.newFileSize) 51 | } 52 | } 53 | ipcRenderer.on("update-buffer-realtime", updateBufferRealtime) 54 | return () => { 55 | ipcRenderer.removeListener("update-buffer-realtime", updateBufferRealtime) 56 | } 57 | }) 58 | 59 | const resetZoom = () => { 60 | zoomRef?.current!.resetTransform(0) 61 | } 62 | 63 | const zoomIn = () => { 64 | zoomRef?.current!.zoomIn(0.5, 0) 65 | } 66 | 67 | const zoomOut = () => { 68 | zoomRef?.current!.zoomOut(0.5, 0) 69 | } 70 | 71 | return ( 72 |
    73 | 74 | setZoomScale(ref.state.scale)} wheel={{step: 0.1}} pinch={{disabled: true}} zoomAnimation={{disabled: true}} alignmentAnimation={{disabled: true}} doubleClick={{mode: "reset", animationTime: 0}}> 75 | 76 |
    77 |

    {oldFileSize}

    {newFileSize}

    } 80 | itemOne={} 81 | itemTwo={} 82 | /> 83 |
    84 |
    85 |
    86 |
    87 | ) 88 | } 89 | 90 | ReactDom.render(, document.getElementById("root")) -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## Image Compressor 2 | 3 | 4 | 5 | This is a bulk image compressor, resizer, and renamer. Great for organizing your anime art collection. You can reduce the size of images/GIFs, delete duplicate images, and rename pictures according to the source (from saucenao). 6 | 7 | ### Features: 8 | - Compress and resize images (PNG/JPG/WEBP/AVIF/JXL) and GIFs/Animated WebPs 9 | - Rename pictures according to the source from saucenao (original title, artist, pixiv ID, etc.) 10 | - Delete duplicate images (the one with the greatest dimensions is retained) 11 | - Flatten a folder (move all files in sub-folders to the parent and delete sub-folders) 12 | - Convert images to PDF (or a directory containing images) 13 | - Convert PDFs to image directories 14 | - Choose to overwrite images or write to a folder 15 | - Ignore images under a certain file size (to avoid over-compression) 16 | - Preview before and after images (right click on the thumbnails) 17 | 18 | ### Rename Template: 19 | You can customize the output names. If it results in a blank name (eg. not found) it will default to using the same name as the input. If the "Overwrite" option is on, the original file is overwritten with the compressed file first and then renamed after. These are all the special replacements: 20 | 21 | {name} - The name of the original file. \ 22 | {title} - The title of the Pixiv illustration, if found. \ 23 | {englishTitle} - The title, but translated to English. \ 24 | {id} - The Pixiv ID of the illustration, if found. \ 25 | {artist} - The artist of the illustration, if found. \ 26 | {width} - The destination width. \ 27 | {height} - The destination height. 28 | 29 | ### Titlebar Buttons 30 | There are many utility functions on the titlebar. They do the following: 31 | 32 | VTT - If ASS or SRT files are selected, they will be converted to a VTT file. If MKV videos are selected, the subtitles are 33 | extracted and converted to VTT. If a directory is selected, all MKV, ASS, and SRT files are converted in that directory. The original files are deleted. 34 | 35 | Rename - Select files within a directory and they are renamed according to the name of the directory. For example, if the directory is named 36 | "Yuru Yuri" the files will be renamed "Yuru Yuri 1", "Yuru Yuri 2", etc. going by alphabetic order. 37 | 38 | Image Cover - If PDF files are selected, it extracts the first image (the cover image). If a directory is selected, it converts all double 39 | pages to single pages (images with twice the width of all others). If images are selected, it converts all double pages to singles - if all images are the same width, 40 | they are all treated as double pages. All original files are deleted. 41 | 42 | PDF - If PDF files are selected, it converts it into a directory of images. If directories or images are selected, it converts them into PDF files. Sometimes the first function results in PPM image files, if you select PPM files they will be converted to JPG files. 43 | 44 | Flatten - Flattens a directory, meaning that all files in all sub-directories are moved to the top level and the sub-directories are removed. This 45 | attempts to prevent naming conflicts by renaming files if the name would conflict with another. 46 | 47 | 48 | ### Keyboard Shortcuts 49 | - Ctrl O - Open images 50 | - Drag and drop - Open images 51 | 52 | ### Installation 53 | 54 | Download the installer from the [releases](https://github.com/Moebits/Image-Compressor/releases) tab. 55 | 56 | ### MacOS 57 | 58 | On MacOS unsigned applications won't open, run this to remove the quarantine flag. 59 | ``` 60 | xattr -d com.apple.quarantine /Applications/Image\ Compressor.app 61 | ``` 62 | 63 | ### Bugs and Requests 64 | 65 | Open an issue on my GitHub repository. 66 | 67 | ### Also See 68 | 69 | - [Waifu2x GUI](https://github.com/Moebits/Waifu2x-GUI) for upscaling images 70 | - [Pixiv Downloader](https://github.com/Moebits/Pixiv-Downloader) for downloading images 71 | - [Photo Viewer](https://github.com/Moebits/Photo-Viewer) for editing images 72 | -------------------------------------------------------------------------------- /renderer.tsx: -------------------------------------------------------------------------------- 1 | import "bootstrap/dist/css/bootstrap.min.css" 2 | import {ipcRenderer} from "electron" 3 | import React, {useState, useEffect} from "react" 4 | import {useDropzone} from "react-dropzone" 5 | import ReactDom from "react-dom" 6 | import LogoBar from "./components/LogoBar" 7 | import TitleBar from "./components/TitleBar" 8 | import VersionDialog from "./components/VersionDialog" 9 | import OptionsBar from "./components/OptionsBar" 10 | import GroupAction from "./components/GroupAction" 11 | import FileContainerList from "./components/FileContainerList" 12 | import "./index.less" 13 | 14 | export const DirectoryContext = React.createContext(null) 15 | export const ClearAllContext = React.createContext(null) 16 | export const QualityContext = React.createContext(null) 17 | export const OverwriteContext = React.createContext(null) 18 | export const IgnoreBelowContext = React.createContext(null) 19 | export const ResizeWidthContext = React.createContext(null) 20 | export const ResizeHeightContext = React.createContext(null) 21 | export const PercentageContext = React.createContext(null) 22 | export const KeepRatioContext = React.createContext(null) 23 | export const RenameContext = React.createContext(null) 24 | export const FormatContext = React.createContext(null) 25 | export const ProgressiveContext = React.createContext(null) 26 | 27 | const App = () => { 28 | const [directory, setDirectory] = useState("") 29 | const [clearAll, setClearAll] = useState(false) 30 | const [quality, setQuality] = useState(75) 31 | const [overwrite, setOverwrite] = useState(true) 32 | const [ignoreBelow, setIgnoreBelow] = useState("0KB") 33 | const [resizeWidth, setResizeWidth] = useState(100) 34 | const [resizeHeight, setResizeHeight] = useState(100) 35 | const [percentage, setPercentage] = useState(true) 36 | const [keepRatio, setKeepRatio] = useState(true) 37 | const [progressive, setProgressive] = useState(true) 38 | const [rename, setRename] = useState("{name}") 39 | const [format, setFormat] = useState("original") 40 | 41 | useEffect(() => { 42 | ipcRenderer.on("debug", console.log) 43 | return () => { 44 | ipcRenderer.removeListener("debug", console.log) 45 | } 46 | }) 47 | 48 | const onDrop = (files: any) => { 49 | files = files.map((f: any) => f.path) 50 | ipcRenderer.invoke("on-drop", files) 51 | } 52 | 53 | const {getRootProps} = useDropzone({onDrop}) 54 | 55 | return ( 56 |
    57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
    88 | ) 89 | } 90 | 91 | ReactDom.render(, document.getElementById("root")) 92 | -------------------------------------------------------------------------------- /structures/functions.ts: -------------------------------------------------------------------------------- 1 | 2 | import GifEncoder from "gif-encoder" 3 | import pixels from "image-pixels" 4 | import gifFrames from "gif-frames" 5 | import fs from "fs" 6 | import path from "path" 7 | import Sagiri from "sagiri" 8 | import {translate} from "bing-translate-api" 9 | 10 | const images = [".png", ".jpg", ".jpeg", ".webp", ".avif", ".jxl", ".tiff"] 11 | const gifs = [".gif"] 12 | 13 | export default class Functions { 14 | public static arrayIncludes = (str: string, arr: string[]) => { 15 | for (let i = 0; i < arr.length; i++) { 16 | if (str.includes(arr[i])) return true 17 | } 18 | return false 19 | } 20 | 21 | public static cleanTitle = (str: string) => { 22 | const ext = path.extname(str) 23 | const split = str.match(/.{1,30}/g)?.join(" ").replace(ext, "")! 24 | return `${split.slice(0, 70)}${ext}` 25 | } 26 | 27 | public static getType = (str: string) => { 28 | if (Functions.arrayIncludes(path.extname(str), images)) return "image" 29 | if (Functions.arrayIncludes(path.extname(str), gifs)) return "gif" 30 | } 31 | 32 | public static arrayRemove = (arr: T[], val: T) => { 33 | return arr.filter((item) => item !== val) 34 | } 35 | 36 | public static removeDuplicates = (array: T[]) => { 37 | return array.filter((a, b) => array.indexOf(a) === b) 38 | } 39 | 40 | public static timeout = async (ms: number) => { 41 | return new Promise((resolve) => setTimeout(resolve, ms)) 42 | } 43 | 44 | public static removeDirectory = (dir: string) => { 45 | if (dir === "/" || dir === "./") return 46 | if (fs.existsSync(dir)) { 47 | fs.readdirSync(dir).forEach(function(entry) { 48 | const entryPath = path.join(dir, entry) 49 | if (fs.lstatSync(entryPath).isDirectory()) { 50 | Functions.removeDirectory(entryPath) 51 | } else { 52 | fs.unlinkSync(entryPath) 53 | } 54 | }) 55 | try { 56 | fs.rmdirSync(dir) 57 | } catch (e) { 58 | console.log(e) 59 | } 60 | } 61 | } 62 | 63 | public static logoDrag = (enable?: boolean) => { 64 | if (enable) { 65 | // @ts-expect-error 66 | document.querySelector(".logo-bar-drag")?.style["-webkit-app-region"] = "drag" 67 | } else { 68 | // @ts-expect-error 69 | document.querySelector(".logo-bar-drag")?.style["-webkit-app-region"] = "no-drag" 70 | } 71 | } 72 | 73 | public static newDest = (dest: string, active: any[]) => { 74 | let duplicate = active.find((a) => a.dest === dest) 75 | let i = 1 76 | let newDest = dest 77 | while (fs.existsSync(newDest) || duplicate) { 78 | newDest = `${path.dirname(dest)}\\${path.basename(dest, path.extname(dest))}_${i}${path.extname(dest)}` 79 | duplicate = active.find((a) => a.dest === newDest) 80 | i++ 81 | } 82 | return newDest 83 | } 84 | 85 | public static countDecimals = (value: number, max?: number) => { 86 | const count = value % 1 ? value.toString().split(".")[1].length : 0 87 | if (max && count > max) return max 88 | return count 89 | } 90 | 91 | public static readableFileSize = (bytes: number) => { 92 | const i = bytes === 0 ? 0 : Math.floor(Math.log(bytes) / Math.log(1024)) 93 | return `${Number((bytes / Math.pow(1024, i)).toFixed(2))} ${["B", "KB", "MB", "GB", "TB"][i]}` 94 | } 95 | 96 | public static parseFileSize = (size: string) => { 97 | if (!size) return 0 98 | const num = parseFloat(size) 99 | if (Number.isNaN(num)) return 0 100 | const type = size.replace(/\d+/g, "").replaceAll(".", "").trim() 101 | let multiplier = 1 102 | if (type === "KB") multiplier = 1000 103 | if (type === "MB") multiplier = 1000000 104 | if (type === "GB") multiplier = 1000000000 105 | if (type === "TB") multiplier = 1000000000000 106 | return num * multiplier 107 | } 108 | 109 | public static parseNewDimensions = (width: number, height: number, resizeWidth: number, resizeHeight: number, percentage: boolean, keepRatio: boolean) => { 110 | let newWidth = width 111 | let newHeight = height 112 | if (keepRatio) { 113 | if (percentage) { 114 | newWidth = width * (resizeWidth / 100) 115 | newHeight = height * (resizeWidth / 100) 116 | } else { 117 | const ratio = resizeWidth / width 118 | newWidth = resizeWidth 119 | newHeight = height * ratio 120 | } 121 | } else { 122 | if (percentage) { 123 | newWidth = width * (resizeWidth / 100) 124 | newHeight = height * (resizeHeight / 100) 125 | } else { 126 | newWidth = resizeWidth 127 | newHeight = resizeHeight 128 | } 129 | } 130 | return {width: parseInt(String(newWidth)), height: parseInt(String(newHeight))} 131 | } 132 | 133 | public static translateTitle = async (title: string) => { 134 | if (!title) return "" 135 | try { 136 | const translated = await translate(title, "ja", "en") 137 | return translated.translation 138 | } catch { 139 | return title 140 | } 141 | } 142 | 143 | public static parseDest = async (source: string, dir: string, rename: string, format: string, width: number, height: number, overwrite: boolean) => { 144 | const sourceDir = path.dirname(source) 145 | const name = path.basename(source, path.extname(source)) 146 | if (format === "original") format = path.extname(source).replaceAll(".", "") 147 | if (/{title}/i.test(rename) || /{id}/i.test(rename) || /{artist}/i.test(rename) || /{englishTitle}/i.test(rename)) { 148 | await Functions.timeout(1000) 149 | try { 150 | const sagiri = Sagiri("93ccce3cc10aed8078633c67abe3e327dea87451") 151 | const results = await sagiri(source, {mask: [5]}) 152 | const englishTitle = await Functions.translateTitle(results[0].raw.data.title) 153 | rename = rename 154 | ?.replace(/{title}/gi, results[0].raw.data.title ?? "") 155 | .replace(/{englishTitle}/gi, englishTitle) 156 | .replace(/{id}/gi, results[0].raw.data.pixiv_id ?? "") 157 | .replace(/{artist}/gi, results[0].raw.data.member_name ?? "") 158 | } catch { 159 | rename = rename 160 | ?.replace(/{title}/gi, "") 161 | .replace(/{englishTitle}/gi, "") 162 | .replace(/{id}/gi, "") 163 | .replace(/{artist}/gi, "") 164 | } 165 | } 166 | rename = rename 167 | ?.replace(/{name}/gi, name) 168 | .replace(/{width}/gi, String(width)) 169 | .replace(/{height}/gi, String(height)) 170 | if (!rename) rename = name 171 | let dest = `${overwrite ? sourceDir : dir}/${rename}.${format}` 172 | if (!overwrite && fs.existsSync(dest)) { 173 | let i = 1 174 | while (fs.existsSync(dest)) { 175 | dest = `${overwrite ? sourceDir : dir}/${rename}_${i}.${format}` 176 | i++ 177 | } 178 | } 179 | return dest 180 | } 181 | 182 | public static streamToBuffer = async (stream: NodeJS.ReadableStream) => { 183 | const chunks: Buffer[] = [] 184 | const buffer = await new Promise((resolve, reject) => { 185 | stream.on("data", (chunk: Buffer) => chunks.push(Buffer.from(chunk))) 186 | stream.on("error", (err) => reject(err)) 187 | stream.on("end", () => resolve(Buffer.concat(chunks))) 188 | }) 189 | return buffer 190 | } 191 | 192 | public static encodeGIF = async (frames: Buffer[], delays: number[], width: number, height: number) => { 193 | const gif = new GifEncoder(width, height, {highWaterMark: 5 * 1024 * 1024}) 194 | gif.setQuality(10) 195 | gif.setRepeat(0) 196 | gif.writeHeader() 197 | let counter = 0 198 | 199 | const addToGif = async (frames: Buffer[]) => { 200 | if (!frames[counter]) { 201 | gif.finish() 202 | } else { 203 | const {data} = await pixels(frames[counter]) 204 | gif.setDelay(delays[counter]) 205 | gif.addFrame(data) 206 | counter++ 207 | addToGif(frames) 208 | } 209 | } 210 | await addToGif(frames) 211 | return Functions.streamToBuffer(gif as NodeJS.ReadableStream) 212 | } 213 | 214 | public static getGIFFrames = async (image: string, options?: {speed?: number, reverse?: boolean, cumulative?: boolean}) => { 215 | if (!options) options = {} as {speed: number, reverse: boolean, cumulative: boolean} 216 | if (!options.speed) options.speed = 1 217 | if (!options.reverse) options.reverse = false 218 | if (!options.cumulative) options.cumulative = true 219 | const frames = await gifFrames({url: image, frames: "all", outputType: "png", cumulative: options.cumulative}) 220 | let frameArray = [] as Buffer[] 221 | let delayArray = [] as number[] 222 | const constraint = options.speed > 1 ? frames.length / options.speed : frames.length 223 | let step = Math.ceil(frames.length / constraint) 224 | for (let i = 0; i < frames.length; i += step) { 225 | frameArray.push(await Functions.streamToBuffer(frames[i].getImage())) 226 | delayArray.push(frames[i].frameInfo.delay * 10) 227 | } 228 | if (options.speed < 1) delayArray = delayArray.map((n) => n / options?.speed!) 229 | if (options.reverse) { 230 | frameArray = frameArray.reverse() 231 | delayArray = delayArray.reverse() 232 | } 233 | return {frameArray, delayArray} 234 | } 235 | 236 | public static arrayBufferToBuffer(arrayBuffer: ArrayBuffer) { 237 | if (!arrayBuffer.byteLength) arrayBuffer = fs.readFileSync(arrayBuffer as unknown as string) 238 | const buffer = Buffer.alloc(arrayBuffer.byteLength) 239 | const array = new Uint8Array(arrayBuffer) 240 | for (let i = 0; i < buffer.length; i++) { 241 | buffer[i] = array[i] 242 | } 243 | return buffer 244 | } 245 | 246 | public static bufferToBase64 = (buffer: Buffer, type: string) => { 247 | return `data:${type};base64,${buffer.toString("base64")}` 248 | } 249 | 250 | public static ass2vtt = (ass: string) => { 251 | const parseTime = (timeString: string) => { 252 | const parts = timeString.split(":").map(parseFloat) 253 | let seconds = parts[0] * 3600 + parts[1] * 60 + parts[2] as any 254 | const hours = Math.floor(seconds / 3600) 255 | seconds %= 3600 256 | const minutes = Math.floor(seconds / 60) 257 | seconds %= 60 258 | seconds = seconds.toFixed(3) 259 | return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(6, "0")}` 260 | } 261 | 262 | const lines = ass.split("\n") 263 | const newLines = ["WEBVTT"] 264 | 265 | const styles = [] 266 | const styleKeys = ["Name", "Fontname", "Fontsize", "PrimaryColour", "SecondaryColour", 267 | "OutlineColour", "BackColour", "Bold", "Italic", "Underline", "Strikeout", 268 | "ScaleX", "ScaleY", "Spacing", "Angle", "BorderStyle", "Outline", "Shadow", 269 | "Alignment", "MarginL", "MarginR", "MarginV", "Encoding"] 270 | const dialogueKeys = ["Layer", "Start", "End", "Style", "Name", "MarginL", "MarginR", "MarginV", "Effect", "Text"] 271 | let counter = 1 272 | for (let i = 0; i < lines.length; i++) { 273 | let line = lines[i] 274 | if (lines[i].startsWith("Style")) { 275 | const values = lines[i].replace("Style: ", "").split(",") 276 | let obj = {} as any 277 | for (let j = 0; j < values.length; j++) { 278 | obj[styleKeys[j]] = values[j] 279 | } 280 | styles.push(obj) 281 | } 282 | if (lines[i].startsWith("Dialogue")) { 283 | let values = lines[i].replace("Dialogue: ", "").split(",") 284 | values = values.slice(0, 9).concat(values.slice(9).join(' ')) 285 | let obj = {} as any 286 | for (let j = 0; j < values.length; j++) { 287 | obj[dialogueKeys[j]] = values[j] 288 | } 289 | //const styling = styles.find((s) => s.Name === obj.Style) 290 | let text = obj.Text.replace(/\\N/g, "\n").replace(/\{.*?\}/g, "").trim() 291 | const line = `\n${counter++}\n${parseTime(obj.Start)} --> ${parseTime(obj.End)}\n${text}` 292 | newLines.push(line) 293 | } 294 | } 295 | return newLines.join("\n") 296 | } 297 | 298 | public static isAnimatedWebp = (buffer: Buffer) => { 299 | let str = buffer.toString("utf-8") 300 | if (str.includes("ANMF")) { 301 | return true 302 | } else { 303 | return false 304 | } 305 | } 306 | } 307 | -------------------------------------------------------------------------------- /styles/filecontainer.less: -------------------------------------------------------------------------------- 1 | @import "../index.less"; 2 | 3 | .file-wrap-container { 4 | display: flex; 5 | flex-direction: row; 6 | justify-content: center; 7 | margin-top: 10px; 8 | margin-bottom: 10px; 9 | } 10 | 11 | .file-container { 12 | display: flex; 13 | cursor: pointer; 14 | width: 100%; 15 | margin-left: 15px; 16 | margin-right: 15px; 17 | justify-content: space-between; 18 | background-color: #f63447; 19 | border-radius: 10px; 20 | border: 4px solid #ff7d9d; 21 | } 22 | 23 | .file-img-container { 24 | display: flex; 25 | justify-content: center; 26 | align-items: center; 27 | cursor: pointer; 28 | width: 40%; 29 | } 30 | 31 | .file-img { 32 | padding-left: 5px; 33 | height: auto; 34 | width: auto; 35 | max-height: 120px; 36 | max-width: 300px; 37 | padding-right: 5px; 38 | &:focus { 39 | outline: none; 40 | } 41 | } 42 | 43 | .file-middle { 44 | display: flex; 45 | flex-direction: column; 46 | width: 100%; 47 | justify-content: space-between; 48 | } 49 | 50 | .file-expand { 51 | cursor: pointer; 52 | margin-left: 10px; 53 | } 54 | 55 | .file-arrow { 56 | margin-left: 10px; 57 | margin-right: 10px; 58 | user-select: text; 59 | cursor: text; 60 | } 61 | 62 | .file-info { 63 | display: flex; 64 | flex-direction: row; 65 | align-items: center; 66 | } 67 | 68 | .file-info-col-container { 69 | display: flex; 70 | flex-direction: row; 71 | align-items: center; 72 | justify-content: space-between; 73 | flex-wrap: wrap; 74 | } 75 | 76 | .file-info-col { 77 | display: flex; 78 | flex-direction: column; 79 | justify-content: space-around; 80 | align-items: flex-start; 81 | &:last-child { 82 | align-items: flex-end; 83 | justify-content: flex-end; 84 | margin-right: 20px; 85 | } 86 | } 87 | 88 | .file-name { 89 | display: flex; 90 | flex-direction: row; 91 | align-items: center; 92 | margin-right: 10px; 93 | } 94 | 95 | .file-label { 96 | max-height: 90%; 97 | width: auto; 98 | margin-left: 7px; 99 | margin-right: 7px; 100 | } 101 | 102 | .file-buttons { 103 | display: flex; 104 | width: 30%; 105 | margin-bottom: 7px; 106 | flex-direction: column; 107 | justify-content: center; 108 | align-content: space-around; 109 | align-items: center; 110 | position: relative; 111 | } 112 | 113 | .file-button-row { 114 | display: flex; 115 | flex-direction: row; 116 | justify-content: space-evenly; 117 | margin-top: 7px; 118 | } 119 | 120 | .file-text { 121 | color: black; 122 | font-family: "Yusei Magic", sans-serif; 123 | user-select: text; 124 | cursor: text; 125 | font-size: 2.2vw; 126 | } 127 | 128 | .bigger { 129 | font-size: 2.5vw; 130 | } 131 | 132 | .file-text-alt { 133 | color: black; 134 | font-family: "Skranji", sans-serif; 135 | flex-shrink: 0; 136 | user-select: text; 137 | cursor: text; 138 | font-size: 2vw; 139 | margin-bottom: -6px; 140 | } 141 | 142 | .file-text-progress { 143 | color: white; 144 | font-family: "Skranji", sans-serif; 145 | position: absolute; 146 | top: -3px; 147 | } 148 | 149 | .file-button { 150 | cursor: pointer; 151 | padding-right: 5px; 152 | } 153 | 154 | .start-button { 155 | width: 90%; 156 | height: auto; 157 | } 158 | 159 | .close-container { 160 | position: absolute; 161 | top: -12px; 162 | right: -18px; 163 | } 164 | 165 | .file-text-progress-container { 166 | display: flex; 167 | justify-content: center; 168 | align-items: center; 169 | position: relative; 170 | } 171 | 172 | .file-progress { 173 | margin-bottom: 5px; 174 | margin-right: 10px; 175 | } 176 | 177 | .progress { 178 | background-color: black !important; 179 | } 180 | 181 | .progress-bar { 182 | background-color: #f8467b; 183 | } 184 | 185 | .margin-left { 186 | margin-left: 7px; 187 | } 188 | 189 | .black { 190 | color: black; 191 | } 192 | 193 | .hover:hover { 194 | color: white !important; 195 | } 196 | 197 | @media (max-width: 720px) { 198 | .file-info-col { 199 | width: 100%; 200 | } 201 | .file-text-alt { 202 | margin-bottom: 0px; 203 | } 204 | } 205 | 206 | .pink { 207 | margin-left: 15px; 208 | color: #ff6bf3 !important; 209 | } -------------------------------------------------------------------------------- /styles/filecontainerlist.less: -------------------------------------------------------------------------------- 1 | @import "../index.less"; 2 | 3 | .placeholder { 4 | visibility: hidden; 5 | } 6 | 7 | .dragged { 8 | position: relative; 9 | z-index: 500; 10 | } -------------------------------------------------------------------------------- /styles/groupaction.less: -------------------------------------------------------------------------------- 1 | @import "../index.less"; 2 | 3 | .group-action-container { 4 | display: flex; 5 | flex-direction: row; 6 | justify-content: center; 7 | align-items: center; 8 | width: 100%; 9 | margin-top: 10px; 10 | margin-bottom: 5px; 11 | } 12 | 13 | .group-action-button { 14 | margin-left: 20px; 15 | height: auto; 16 | width: auto; 17 | max-height: 30px; 18 | cursor: pointer; 19 | } -------------------------------------------------------------------------------- /styles/logobar.less: -------------------------------------------------------------------------------- 1 | @import "../index.less"; 2 | @import "./titlebar.less"; 3 | 4 | .logo-bar { 5 | display: flex; 6 | flex-direction: row; 7 | justify-content: center; 8 | padding-top: @title-bar-height; 9 | margin-top: 15px; 10 | margin-bottom: 15px; 11 | } 12 | 13 | .logo-bar-container { 14 | position: relative; 15 | display: flex; 16 | justify-content: center; 17 | width: 95%; 18 | } 19 | 20 | .logo-bar-drag { 21 | -webkit-app-region: drag; 22 | position: absolute; 23 | margin: auto; 24 | top: 0; 25 | bottom: 0; 26 | left: 0; 27 | right: 0; 28 | width: 80%; 29 | } 30 | 31 | .logo { 32 | height: auto; 33 | width: 85%; 34 | min-height: 30px; 35 | } -------------------------------------------------------------------------------- /styles/optionsbar.less: -------------------------------------------------------------------------------- 1 | @import "../index.less"; 2 | 3 | .options-bar { 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: center; 8 | margin-top: 7px; 9 | width: 100%; 10 | } 11 | 12 | .options-bar-row { 13 | margin-top: 10px; 14 | margin-left: 55px; 15 | display: flex; 16 | flex-direction: row; 17 | align-items: center; 18 | width: 100%; 19 | } 20 | 21 | .options-bar-box { 22 | display: flex; 23 | align-items: center; 24 | flex-direction: row; 25 | justify-content: space-evenly; 26 | margin-right: 35px; 27 | } 28 | 29 | .options-bar-text { 30 | color: var(--text-color); 31 | font-size: 23px; 32 | font-family: "Maven Pro", sans-serif; 33 | cursor: text; 34 | user-select: text; 35 | } 36 | 37 | .options-bar-input { 38 | margin-left: 6px; 39 | color: var(--text-color); 40 | font-size: 23px; 41 | font-family: "Maven Pro", sans-serif; 42 | height: 30px; 43 | width: 50px; 44 | border: none; 45 | background-color: transparent; 46 | &:focus { 47 | outline: none; 48 | } 49 | &:first-child { 50 | width: 20px; 51 | } 52 | } 53 | 54 | .wide { 55 | width: 100px; 56 | } 57 | 58 | .options-bar-checkbox { 59 | border: none; 60 | cursor: pointer; 61 | transform: scale(1.5); 62 | margin-right: 10px; 63 | } 64 | 65 | .btn { 66 | color: black; 67 | font-size: 17px; 68 | font-family: "Maven Pro", sans-serif; 69 | padding: 1px 3px; 70 | background-color: #ee3453; 71 | border-color: transparent; 72 | margin-left: 10px; 73 | margin-right: 10px; 74 | &:hover { 75 | border-color: transparent; 76 | background-color: #f04460; 77 | } 78 | &:focus { 79 | color: black !important; 80 | border-color: transparent !important; 81 | background-color: #f54150 !important; 82 | box-shadow: none !important; 83 | } 84 | } 85 | 86 | .dropdown-toggle { 87 | color: black !important; 88 | border-color: transparent !important; 89 | background-color: #fc4160 !important; 90 | &:hover { 91 | color: white !important; 92 | } 93 | &::after { 94 | content: none !important; 95 | } 96 | } 97 | 98 | .dropdown-menu { 99 | background-color: #f73152; 100 | min-width: 0; 101 | padding: 0; 102 | border: none; 103 | } 104 | 105 | .dropdown-item { 106 | color: black; 107 | font-size: 15px; 108 | font-family: "Maven Pro", sans-serif; 109 | padding: 3px 2px; 110 | &:hover { 111 | background-color: #f8939b; 112 | } 113 | } 114 | 115 | .dropdown-item.active, .dropdown-item:active { 116 | background-color: #ee505d; 117 | } 118 | 119 | .pointer { 120 | cursor: pointer; 121 | } 122 | 123 | .default-button { 124 | border: none; 125 | font-family: "Skranji", sans-serif; 126 | font-size: 1.5rem; 127 | color: white; 128 | margin-right: 35px; 129 | padding-left: 0.6rem; 130 | padding-right: 0.6rem; 131 | span:hover { 132 | cursor: pointer; 133 | color: black; 134 | } 135 | } 136 | 137 | .upload-button { 138 | .default-button(); 139 | background-color: #ff3a42; 140 | } 141 | 142 | .options-slider.rc-slider { 143 | margin-left: 15px; 144 | margin-right: 15px; 145 | width: 40%; 146 | border-radius: 0.2; 147 | align-items: center; 148 | } 149 | 150 | .options-slider > .rc-slider-rail { 151 | height: 0.4rem; 152 | background-color: black; 153 | border-radius: 0.2; 154 | } 155 | 156 | .options-slider > .rc-slider-track { 157 | height: 0.4rem; 158 | background-color: #fa4160; 159 | border-radius: 0.2; 160 | } 161 | 162 | .options-slider > .rc-slider-handle { 163 | margin-top: -7px; 164 | border: none; 165 | height: 1.3rem; 166 | width: 1.3rem; 167 | &:active { 168 | box-shadow: none; 169 | filter: hue-rotate(-30deg); 170 | } 171 | &:hover { 172 | filter: hue-rotate(-30deg); 173 | } 174 | } 175 | 176 | .options-slider > .rc-slider-handle { 177 | content: url("../assets/icons/volume-thumb.png"); 178 | background-color: black; 179 | } 180 | 181 | .rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging { 182 | box-shadow: none; 183 | } 184 | 185 | .download-location { 186 | display: flex; 187 | flex-direction: row; 188 | align-items: center; 189 | margin-right: 35px; 190 | margin-top: 8px; 191 | } 192 | 193 | .download-location-text { 194 | color: var(--text-color); 195 | user-select: text; 196 | font-family: "Fira Sans", sans-serif; 197 | font-size: 18px; 198 | margin-left: 5px; 199 | } 200 | 201 | .download-location-img { 202 | cursor: pointer; 203 | } -------------------------------------------------------------------------------- /styles/previewtitlebar.less: -------------------------------------------------------------------------------- 1 | @import "../preview.less"; 2 | 3 | .title-bar { 4 | display: flex; 5 | align-items: flex-end; 6 | justify-content: center; 7 | user-select: none; 8 | position: fixed; 9 | top: 0px; 10 | width: 100%; 11 | height: @title-bar-height; 12 | background-color: #1d1d1d; 13 | z-index: 1000; 14 | -webkit-app-region: no-drag; 15 | } 16 | 17 | .title-bar-drag-area { 18 | -webkit-app-region: drag; 19 | display: flex; 20 | align-items: center; 21 | justify-content: center; 22 | width: 99%; 23 | height: 90%; 24 | } 25 | 26 | .title-container { 27 | margin-left: 10px; 28 | margin-top: 3px; 29 | display: flex; 30 | flex-direction: row; 31 | align-items: center; 32 | position: fixed; 33 | z-index: 2000; 34 | top: 0px; 35 | left: 0px; 36 | } 37 | 38 | .title { 39 | margin-left: 3px; 40 | user-select: text; 41 | color: white; 42 | font-size: 18px; 43 | font-family: "Maven Pro", sans-serif; 44 | &:hover { 45 | cursor: text; 46 | color: white; 47 | } 48 | } 49 | 50 | .title-bar-buttons { 51 | -webkit-app-region: no-drag; 52 | display: flex; 53 | flex-direction: row; 54 | position: fixed; 55 | z-index: 2000; 56 | top: 0px; 57 | right: 0px; 58 | } 59 | 60 | .title-bar-button { 61 | -webkit-app-region: no-drag; 62 | margin-top: 3px; 63 | margin-right: 12px; 64 | &:hover { 65 | cursor: pointer; 66 | } 67 | } -------------------------------------------------------------------------------- /styles/titlebar.less: -------------------------------------------------------------------------------- 1 | @import "../index.less"; 2 | 3 | @title-bar-height: 30px; 4 | 5 | .title-bar { 6 | display: flex; 7 | align-items: flex-end; 8 | justify-content: center; 9 | user-select: none; 10 | position: fixed; 11 | top: 0px; 12 | width: 100%; 13 | height: @title-bar-height; 14 | background-color: var(--title-color); 15 | z-index: 1000; 16 | -webkit-app-region: no-drag; 17 | } 18 | 19 | .title-bar-drag-area { 20 | -webkit-app-region: drag; 21 | display: flex; 22 | align-items: center; 23 | width: 99%; 24 | height: 90%; 25 | } 26 | 27 | .title-container { 28 | margin-left: 3px; 29 | display: flex; 30 | flex-direction: row; 31 | align-items: center; 32 | position: fixed; 33 | z-index: 2000; 34 | top: 0px; 35 | left: 0px; 36 | } 37 | 38 | .title { 39 | margin-left: 5px; 40 | user-select: text; 41 | color: var(--text-color); 42 | font-size: 18px; 43 | font-family: "Maven Pro", sans-serif; 44 | &:hover { 45 | cursor: text; 46 | color: white; 47 | } 48 | } 49 | 50 | .title-bar-buttons { 51 | -webkit-app-region: no-drag; 52 | display: flex; 53 | flex-direction: row; 54 | position: fixed; 55 | z-index: 2000; 56 | top: 0px; 57 | right: 0px; 58 | } 59 | 60 | .title-bar-button { 61 | -webkit-app-region: no-drag; 62 | margin-top: 3px; 63 | margin-right: 12px; 64 | &:hover { 65 | cursor: pointer; 66 | } 67 | } 68 | 69 | @keyframes rotation { 70 | from { 71 | transform: rotate(0deg); 72 | } 73 | to { 74 | transform: rotate(360deg); 75 | } 76 | } 77 | 78 | .update-button:hover { 79 | animation: rotation 2s linear 0s infinite forwards; 80 | } 81 | 82 | .settings-button:hover { 83 | animation: rotation 5s linear 0s infinite forwards; 84 | } -------------------------------------------------------------------------------- /styles/versiondialog.less: -------------------------------------------------------------------------------- 1 | @import "../index.less"; 2 | @import "./titlebar.less"; 3 | 4 | .version-dialog { 5 | position: fixed; 6 | z-index: 700; 7 | display: flex; 8 | width: 100%; 9 | height: 100%; 10 | flex-direction: row; 11 | justify-content: center; 12 | align-items: center; 13 | padding-top: @title-bar-height; 14 | background-color: rgba(0, 0, 0, 0.5); 15 | pointer-events: none; 16 | } 17 | 18 | .version-dialog-box { 19 | pointer-events: all; 20 | margin-top: -100px; 21 | width: 40%; 22 | height: 30%; 23 | border-radius: 10px; 24 | background-color: var(--version-color); 25 | padding: 10px; 26 | display: flex; 27 | flex-direction: column; 28 | justify-content: space-between; 29 | } 30 | 31 | .version-container { 32 | width: 100%; 33 | height: 100%; 34 | display: flex; 35 | flex-direction: column; 36 | justify-content: space-between; 37 | } 38 | 39 | .version-dialog-text { 40 | color: var(--version-text); 41 | cursor: text; 42 | user-select: text; 43 | font-size: 20px; 44 | font-family: "Maven Pro", sans-serif; 45 | &::selection { 46 | background-color: #7da0ff; 47 | } 48 | } 49 | 50 | .version-button-container { 51 | display: flex; 52 | margin-top: 5px; 53 | justify-content: space-evenly; 54 | } 55 | 56 | .reject-button { 57 | border: none; 58 | padding-top: 7px; 59 | padding-bottom: 7px; 60 | padding-left: 14px; 61 | padding-right: 14px; 62 | color: var(--version-reject-text); 63 | font-size: 20px; 64 | font-family: "Maven Pro", sans-serif; 65 | background-color: var(--version-reject); 66 | border: 3px solid var(--version-reject-text); 67 | &:hover { 68 | color: white; 69 | border: 3px solid white; 70 | cursor: pointer; 71 | } 72 | } 73 | 74 | .accept-button { 75 | border: none; 76 | padding-top: 7px; 77 | padding-bottom: 7px; 78 | padding-left: 14px; 79 | padding-right: 14px; 80 | color: var(--version-accept-text); 81 | font-size: 20px; 82 | font-family: "Maven Pro", sans-serif; 83 | background-color: var(--version-accept); 84 | border: 3px solid var(--version-accept-text); 85 | &:hover { 86 | color: white; 87 | border: 3px solid white; 88 | cursor: pointer; 89 | } 90 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "moduleResolution": "node", 5 | "target": "es2017", 6 | "module": "esnext", 7 | "lib": ["dom", "esnext"], 8 | "allowJs": true, 9 | "allowSyntheticDefaultImports": true, 10 | "jsx": "react", 11 | "strict": true, 12 | "skipLibCheck": true, 13 | "strictNullChecks": true, 14 | "resolveJsonModule": true 15 | }, 16 | "exclude": [ 17 | "node_modules", 18 | "dist" 19 | ] 20 | } -------------------------------------------------------------------------------- /vendor/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/.DS_Store -------------------------------------------------------------------------------- /vendor/cjpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/cjpeg -------------------------------------------------------------------------------- /vendor/cjpeg.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/cjpeg.exe -------------------------------------------------------------------------------- /vendor/cwebp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/cwebp -------------------------------------------------------------------------------- /vendor/cwebp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/cwebp.exe -------------------------------------------------------------------------------- /vendor/gifsicle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/gifsicle -------------------------------------------------------------------------------- /vendor/gifsicle.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/gifsicle.exe -------------------------------------------------------------------------------- /vendor/pngquant: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/pngquant -------------------------------------------------------------------------------- /vendor/pngquant.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Moebits/Image-Compressor/fa4b43794b1e827a47289be055e61bf8c10d9b97/vendor/pngquant.exe -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const HtmlWebpackPlugin = require("html-webpack-plugin") 2 | const MiniCssExtractPlugin = require("mini-css-extract-plugin") 3 | const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin") 4 | const TerserJSPlugin = require("terser-webpack-plugin") 5 | const path = require("path") 6 | const webpack = require("webpack") 7 | const exclude = [/node_modules/, /dist/] 8 | 9 | module.exports = [ 10 | { 11 | target: "electron-renderer", 12 | entry: "./renderer", 13 | mode: "production", 14 | node: {__dirname: false}, 15 | output: {filename: "renderer.js", path: path.resolve(__dirname, "./dist"), publicPath: "./"}, 16 | resolve: {extensions: [".js", ".jsx", ".ts", ".tsx"], mainFields: ["main", "module", "browser"], alias: {"react-dom$": "react-dom/profiling", "scheduler/tracing": "scheduler/tracing-profiling"}}, 17 | optimization: {minimize: true, minimizer: [new TerserJSPlugin({extractComments: false})], moduleIds: "named"}, 18 | module: { 19 | rules: [ 20 | {test: /\.(jpe?g|png|gif|svg|mp3|wav|mp4|yml|txt)$/, exclude, use: [{loader: "file-loader", options: {name: "[path][name].[ext]"}}]}, 21 | {test: /\.html$/, exclude, use: [{loader: "html-loader", options: {minimize: false}}]}, 22 | {test: /\.less$/, exclude, use: [{loader: MiniCssExtractPlugin.loader}, "css-loader", "less-loader"]}, 23 | {test: /\.css$/, use: [{loader: MiniCssExtractPlugin.loader}, "css-loader"]}, 24 | {test: /\.(tsx?|jsx?)$/, exclude, use: [{loader: "ts-loader", options: {transpileOnly: true}}]} 25 | ] 26 | }, 27 | plugins: [ 28 | new ForkTsCheckerWebpackPlugin(), 29 | new HtmlWebpackPlugin({template: path.resolve(__dirname, "./index.html"), minify: true}), 30 | new MiniCssExtractPlugin({filename: "styles.css", chunkFilename: "styles.css"}), 31 | new webpack.DefinePlugin({"process.env.FLUENTFFMPEG_COV": false}) 32 | ], 33 | devServer: {contentBase: path.join(__dirname, "./dist"), port: 9000, compress: true, hot: true, historyApiFallback: true, publicPath: "/"}, 34 | }, 35 | { 36 | target: "electron-renderer", 37 | entry: "./preview", 38 | mode: "production", 39 | node: {__dirname: false}, 40 | output: {filename: "preview.js", path: path.resolve(__dirname, "./dist"), publicPath: "./"}, 41 | resolve: {extensions: [".js", ".jsx", ".ts", ".tsx"], mainFields: ["main", "module", "browser"], alias: {"react-dom$": "react-dom/profiling", "scheduler/tracing": "scheduler/tracing-profiling"}}, 42 | optimization: {minimize: true, minimizer: [new TerserJSPlugin({extractComments: false})], moduleIds: "named"}, 43 | module: { 44 | rules: [ 45 | {test: /\.(jpe?g|png|gif|svg|mp3|wav|mp4|yml|txt)$/, exclude, use: [{loader: "file-loader", options: {name: "[path][name].[ext]"}}]}, 46 | {test: /\.html$/, exclude, use: [{loader: "html-loader", options: {minimize: false}}]}, 47 | {test: /\.less$/, exclude, use: [{loader: MiniCssExtractPlugin.loader}, "css-loader", "less-loader"]}, 48 | {test: /\.css$/, use: [{loader: MiniCssExtractPlugin.loader}, "css-loader"]}, 49 | {test: /\.(tsx?|jsx?)$/, exclude, use: [{loader: "ts-loader", options: {transpileOnly: true}}]} 50 | ] 51 | }, 52 | plugins: [ 53 | new ForkTsCheckerWebpackPlugin(), 54 | new HtmlWebpackPlugin({filename: "preview.html", template: path.resolve(__dirname, "./preview.html"), minify: true}), 55 | new MiniCssExtractPlugin({filename: "preview.css", chunkFilename: "preview.css"}), 56 | new webpack.DefinePlugin({"process.env.FLUENTFFMPEG_COV": false}) 57 | ] 58 | }, 59 | { 60 | target: "electron-main", 61 | entry: "./main", 62 | mode: "production", 63 | node: {__dirname: false}, 64 | externals: {"sharp": "commonjs sharp"}, 65 | output: {filename: "main.js", path: path.resolve(__dirname, "./dist")}, 66 | resolve: {extensions: [".js", ".jsx", ".ts", ".tsx"], alias: {"react-dom$": "react-dom/profiling", "scheduler/tracing": "scheduler/tracing-profiling"}}, 67 | optimization: {minimize: true, minimizer: [new TerserJSPlugin({extractComments: false})], moduleIds: "named"}, 68 | module: { 69 | rules: [ 70 | {test: /\.(jpe?g|png|gif|svg|mp3|wav|mp4|yml|txt)$/, exclude, use: [{loader: "file-loader", options: {name: "[path][name].[ext]"}}]}, 71 | {test: /\.afm$/, loader: "raw-loader"}, 72 | {test: /\.(tsx?|jsx?)$/, exclude, use: [{loader: "ts-loader", options: {transpileOnly: true}}]}, 73 | {test: /\.node$/, loader: "node-loader"}, 74 | ] 75 | }, 76 | plugins: [ 77 | new webpack.DefinePlugin({"process.env.FLUENTFFMPEG_COV": false}) 78 | ] 79 | } 80 | ] --------------------------------------------------------------------------------