mirror of
https://github.com/gen2brain/cbconvert
synced 2025-10-14 10:38:51 +02:00
Update thumbnail
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"mime"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
@@ -1667,7 +1666,7 @@ func (c *Convertor) Thumbnail(fileName string, info os.FileInfo) error {
|
|||||||
if err := mw.SetImageProperty("Software", "CBconvert"); err != nil {
|
if err := mw.SetImageProperty("Software", "CBconvert"); err != nil {
|
||||||
return fmt.Errorf("%s: %w", fileName, err)
|
return fmt.Errorf("%s: %w", fileName, err)
|
||||||
}
|
}
|
||||||
if err := mw.SetImageProperty("Description", "Thumbnail of "+fURI); err != nil {
|
if err := mw.SetImageProperty("Description", "Thumbnail of "+fileName); err != nil {
|
||||||
return fmt.Errorf("%s: %w", fileName, err)
|
return fmt.Errorf("%s: %w", fileName, err)
|
||||||
}
|
}
|
||||||
if err := mw.SetImageProperty("Thumb::URI", fURI); err != nil {
|
if err := mw.SetImageProperty("Thumb::URI", fURI); err != nil {
|
||||||
@@ -1679,9 +1678,6 @@ func (c *Convertor) Thumbnail(fileName string, info os.FileInfo) error {
|
|||||||
if err := mw.SetImageProperty("Thumb::Size", strconv.FormatInt(info.Size(), 10)); err != nil {
|
if err := mw.SetImageProperty("Thumb::Size", strconv.FormatInt(info.Size(), 10)); err != nil {
|
||||||
return fmt.Errorf("%s: %w", fileName, err)
|
return fmt.Errorf("%s: %w", fileName, err)
|
||||||
}
|
}
|
||||||
if err := mw.SetImageProperty("Thumb::Mimetype", mime.TypeByExtension(filepath.Ext(fileName))); err != nil {
|
|
||||||
return fmt.Errorf("%s: %w", fileName, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = mw.WriteImage(fName)
|
err = mw.WriteImage(fName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user