diff --git a/docs/todo.md b/docs/todo.md index 179e0555..08d0cc44 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -3,7 +3,6 @@ ### Stuff to do * Repack zips that contain programs with bad filenames, for example: http://localhost:1323/f/ab252e4 -* _Replacement image_ *ALWAYS* prompts for a confirmation. This should only occur if there is an existing image. * _Thumbnail assets_ links need better separation. * `
` * * Does not work, need to use `img` tag. diff --git a/internal/command/command.go b/internal/command/command.go index 1b152ad5..74f22b23 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -55,7 +55,6 @@ const ( Arc = "arc" // Arc is the arc decompression command. Arj = "arj" // Arj is the arj decompression command. Ansilove = "ansilove" // Ansilove is the ansilove text to image command. - Convert = "convert" // Convert is the ImageMagick legacy convert command. Cwebp = "cwebp" // Cwebp is the Google create webp command. Gwebp = "gif2webp" // Gwebp is the Google gif to webp command. HWZip = "hwzip" // Hwzip the zip decompression command for files using obsolete methods. @@ -79,7 +78,6 @@ func Lookups() []string { Arc, Arj, Ansilove, - Convert, Cwebp, Gwebp, HWZip, @@ -100,7 +98,6 @@ func Infos() []string { "archive utility ver 5+", "arj32 ver 3+", "ansilove/c ver 4+", - "ImageMagick ver 6+", "Google WebP ver 1+", "Google GIF to WebP ver 1+", "HWZip ver 2+", diff --git a/internal/command/images.go b/internal/command/images.go index dc21339d..7c81cd99 100644 --- a/internal/command/images.go +++ b/internal/command/images.go @@ -373,7 +373,7 @@ func (dir Dirs) textImagers(debug *zap.SugaredLogger, unid, tmp string) error { return errs } -// PreviewPixels converts the src image to a PNG and webp images in the screenshot directory. +// PreviewPixels converts the src image to a PNG and webp images in the screenshot directory. // A webp thumbnail image is also created and copied to the thumbnail directory. // The conversion is useful for screenshots of text, terminals interfaces and pixel art. // @@ -393,7 +393,7 @@ func (dir Dirs) PreviewPixels(debug *zap.SugaredLogger, src, unid string) error defer os.RemoveAll(tmpDir) // remove temp dir tmp := filepath.Join(tmpDir, name) // temp output file target arg = append(arg, tmp) - if err := RunQuiet(Convert, arg...); err != nil { + if err := RunQuiet(Magick, arg...); err != nil { return fmt.Errorf("preview pixel run convert %w", err) } dst := filepath.Join(dir.Preview, unid+png) @@ -424,7 +424,7 @@ func (dir Dirs) PreviewPhoto(debug *zap.SugaredLogger, src, unid string) error { jtmp := filepath.Join(tmpDir, name) // temp output file target arg = append(arg, jtmp) // destination - if err := RunQuiet(Convert, arg...); err != nil { + if err := RunQuiet(Magick, arg...); err != nil { return fmt.Errorf("preview photo convert %w", err) } wtmp := filepath.Join(tmpDir, unid+webp) @@ -797,7 +797,7 @@ func (dir Dirs) ThumbPixels(src, unid string) error { arg := []string{src} // source file arg = append(arg, args...) // command line arguments arg = append(arg, tmp) // destination - if err := RunQuiet(Convert, arg...); err != nil { + if err := RunQuiet(Magick, arg...); err != nil { return fmt.Errorf("run ansi convert %w", err) } @@ -824,7 +824,7 @@ func (dir Dirs) ThumbPhoto(src, unid string) error { arg := []string{src} // source file arg = append(arg, args...) // command line arguments arg = append(arg, tmp) // destination - if err := RunQuiet(Convert, arg...); err != nil { + if err := RunQuiet(Magick, arg...); err != nil { return fmt.Errorf("run webp convert %w", err) } diff --git a/view/app/artifactfile.tmpl b/view/app/artifactfile.tmpl index b63ce34f..0c5f0788 100644 --- a/view/app/artifactfile.tmpl +++ b/view/app/artifactfile.tmpl @@ -239,7 +239,7 @@ hx-encoding="multipart/form-data" hx-post="/editor/upload/preview" hx-target="#artifact-editor-preview-feedback" - {{- if ne $notFound $statSizeB}}hx-confirm="OK, to replace the existing preview image on the server?"{{end}} + {{- if eq $previewImgStat true}}hx-confirm="OK, to replace the existing preview image on the server?"{{end}} hx-validate="true">