Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matrix-media-repo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
matrix-media-repo
Commits
1ae78235
Commit
1ae78235
authored
1 year ago
by
Travis Ralston
Browse files
Options
Downloads
Patches
Plain Diff
Don't even reference image/jpeg
parent
4adff75b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jpeg2/jpeg_picker.go
+2
-20
2 additions, 20 deletions
jpeg2/jpeg_picker.go
with
2 additions
and
20 deletions
jpeg2/jpeg_picker.go
+
2
−
20
View file @
1ae78235
...
...
@@ -2,35 +2,17 @@ package jpeg2
import
(
"image"
gojpeg
"image/jpeg"
"io"
"github.com/turt2live/matrix-media-repo/util/readers"
libjpeg
"github.com/viam-labs/go-libjpeg/jpeg"
)
func
Decode
(
r
io
.
Reader
)
(
image
.
Image
,
error
)
{
br
:=
readers
.
NewBufferReadsReader
(
r
)
c
,
err
:=
libjpeg
.
Decode
(
r
,
&
libjpeg
.
DecoderOptions
{})
if
err
!=
nil
{
r
=
br
.
GetRewoundReader
()
return
gojpeg
.
Decode
(
r
)
}
else
{
br
.
Discard
()
}
return
c
,
nil
return
libjpeg
.
Decode
(
r
,
&
libjpeg
.
DecoderOptions
{})
}
func
DecodeConfig
(
r
io
.
Reader
)
(
image
.
Config
,
error
)
{
br
:=
readers
.
NewBufferReadsReader
(
r
)
c
,
err
:=
libjpeg
.
DecodeConfig
(
r
)
if
err
!=
nil
{
r
=
br
.
GetRewoundReader
()
return
gojpeg
.
DecodeConfig
(
r
)
}
else
{
br
.
Discard
()
}
return
c
,
nil
return
libjpeg
.
DecodeConfig
(
r
)
}
func
init
()
{
...
...
This diff is collapsed.
Click to expand it.
MickGe
@mickge
mentioned in commit
8e68c194
·
1 year ago
mentioned in commit
8e68c194
mentioned in commit 8e68c194ec6958b6dd9c5c1c48a93519670aec37
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment