Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55dcd54917 | ||
|
|
3e9469c2d1 | ||
|
|
bfa8d0f1a2 | ||
|
|
815c060d55 | ||
|
|
8bd927ec6a | ||
|
|
18738b3273 | ||
|
|
1d8c74dbd9 |
No files matched your search
+1
-2
@@ -14,7 +14,7 @@ require (
|
||||
github.com/google/go-cmp v0.7.0
|
||||
github.com/gtsteffaniak/go-cache v1.0.0
|
||||
github.com/gtsteffaniak/go-logger v0.2.3
|
||||
github.com/kovidgoyal/imaging v1.8.15
|
||||
github.com/kovidgoyal/imaging v1.7.2
|
||||
github.com/pquerna/otp v1.5.0
|
||||
github.com/spf13/afero v1.15.0
|
||||
github.com/stretchr/testify v1.11.1
|
||||
@@ -161,7 +161,6 @@ require (
|
||||
github.com/kisielk/errcheck v1.9.0 // indirect
|
||||
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
|
||||
github.com/kovidgoyal/go-parallel v1.1.1 // indirect
|
||||
github.com/kovidgoyal/go-shm v1.0.0 // indirect
|
||||
github.com/kulti/thelper v0.7.1 // indirect
|
||||
github.com/kunwardeep/paralleltest v1.0.15 // indirect
|
||||
github.com/lasiar/canonicalheader v1.1.2 // indirect
|
||||
|
||||
@@ -548,6 +548,8 @@ github.com/kovidgoyal/go-parallel v1.1.1 h1:1OzpNjtrUkBPq3UaqrnvOoB2F9RttSt811ui
|
||||
github.com/kovidgoyal/go-parallel v1.1.1/go.mod h1:BJNIbe6+hxyFWv7n6oEDPj3PA5qSw5OCtf0hcVxWJiw=
|
||||
github.com/kovidgoyal/go-shm v1.0.0 h1:HJEel9D1F9YhULvClEHJLawoRSj/1u/EDV7MJbBPgQo=
|
||||
github.com/kovidgoyal/go-shm v1.0.0/go.mod h1:Yzb80Xf9L3kaoB2RGok9hHwMIt7Oif61kT6t3+VnZds=
|
||||
github.com/kovidgoyal/imaging v1.7.2 h1:mmT6k6Az3mC6dbqdZ6Q9KQCdZFWTAQ+q97NyGZgJ/2c=
|
||||
github.com/kovidgoyal/imaging v1.7.2/go.mod h1:GdkCORjfZMMGFY0Pb7TDmRhj7PDhxF/QShKukSCj0VU=
|
||||
github.com/kovidgoyal/imaging v1.8.15 h1:FwKRGvmbQ04OFYF5WIalcvUontcnj1chBeHmR5I7UYg=
|
||||
github.com/kovidgoyal/imaging v1.8.15/go.mod h1:aXZHGm/gKcaXpxn1NnQiVtuz3Z2BCnXWyjF0ZGrmJ1g=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
|
||||
@@ -56,11 +56,6 @@ var ResizableImageTypes = map[string]bool{
|
||||
".tif": true,
|
||||
".heic": true,
|
||||
".heif": true,
|
||||
".webp": true,
|
||||
".pbm": true,
|
||||
".pgm": true,
|
||||
".ppm": true,
|
||||
".pam": true,
|
||||
".other": false,
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,6 @@ gif
|
||||
tiff
|
||||
bmp
|
||||
heic
|
||||
webp
|
||||
pbm
|
||||
pgm
|
||||
ppm
|
||||
pam
|
||||
)
|
||||
*/
|
||||
type Format int
|
||||
@@ -44,16 +39,6 @@ func (x Format) toImaging() imaging.Format {
|
||||
return imaging.BMP
|
||||
case FormatHeic:
|
||||
return imaging.JPEG
|
||||
case FormatWebp:
|
||||
return imaging.WEBP
|
||||
case FormatPbm:
|
||||
return imaging.PBM
|
||||
case FormatPgm:
|
||||
return imaging.PGM
|
||||
case FormatPpm:
|
||||
return imaging.PPM
|
||||
case FormatPam:
|
||||
return imaging.PAM
|
||||
default:
|
||||
return imaging.JPEG
|
||||
}
|
||||
@@ -111,16 +96,6 @@ func (s *Service) FormatFromExtension(ext string) (Format, error) {
|
||||
return FormatTiff, nil
|
||||
case imaging.BMP:
|
||||
return FormatBmp, nil
|
||||
case imaging.WEBP:
|
||||
return FormatWebp, nil
|
||||
case imaging.PBM:
|
||||
return FormatPbm, nil
|
||||
case imaging.PGM:
|
||||
return FormatPgm, nil
|
||||
case imaging.PPM:
|
||||
return FormatPpm, nil
|
||||
case imaging.PAM:
|
||||
return FormatPam, nil
|
||||
default:
|
||||
return -1, ErrUnsupportedFormat
|
||||
}
|
||||
@@ -191,25 +166,9 @@ func (s *Service) Resize(in io.Reader, width, height int, out io.Writer, options
|
||||
}
|
||||
|
||||
// For HEIC files, try without AutoOrientation first since it might not work properly
|
||||
// Try decoding with default settings (auto color space conversion)
|
||||
img, err := imaging.Decode(wrappedReader)
|
||||
if err != nil {
|
||||
// If decoding fails due to ICC profile issues (e.g., unsupported grayscale colorspace),
|
||||
// retry with color space conversion disabled
|
||||
if bytes.Contains([]byte(err.Error()), []byte("colorspace")) ||
|
||||
bytes.Contains([]byte(err.Error()), []byte("ICC profile")) {
|
||||
// Reset reader to beginning
|
||||
if seeker, ok := wrappedReader.(io.Seeker); ok {
|
||||
_, _ = seeker.Seek(0, io.SeekStart)
|
||||
}
|
||||
// Try again without color space conversion
|
||||
img, err = imaging.Decode(wrappedReader, imaging.ColorSpace(imaging.NO_CHANGE_OF_COLORSPACE))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to decode image: %w", err)
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("failed to decode image: %w", err)
|
||||
}
|
||||
return fmt.Errorf("failed to decode image: %w", err)
|
||||
}
|
||||
|
||||
// Note: For HEIC files processed via FFmpeg, orientation is handled automatically
|
||||
|
||||
@@ -25,9 +25,11 @@
|
||||
<strong>{{ $t("prompts.size", { suffix: ":" }) }}</strong> {{ humanSize }}
|
||||
<!-- eslint-disable-line @intlify/vue-i18n/no-raw-text -->
|
||||
</div>
|
||||
|
||||
<div v-if="!shareInfo.disableDownload" class="share__box__element share__box__center">
|
||||
<button class="button button--flat clickable" @click="goToDownload()"> {{ $t("general.download") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user