mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-10 13:48:07 -06:00
[chore] Update exif terminator version with codeberg libraries (#3855)
This commit is contained in:
parent
5d0e3d9c35
commit
d8bb1c391b
24 changed files with 60 additions and 59 deletions
2
vendor/codeberg.org/superseriousbusiness/exif-terminator/jpeg.go
generated
vendored
2
vendor/codeberg.org/superseriousbusiness/exif-terminator/jpeg.go
generated
vendored
|
|
@ -23,7 +23,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
|
||||
jpegstructure "github.com/superseriousbusiness/go-jpeg-image-structure/v2"
|
||||
jpegstructure "codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2"
|
||||
)
|
||||
|
||||
var markerLen = map[byte]int{
|
||||
|
|
|
|||
2
vendor/codeberg.org/superseriousbusiness/exif-terminator/png.go
generated
vendored
2
vendor/codeberg.org/superseriousbusiness/exif-terminator/png.go
generated
vendored
|
|
@ -21,7 +21,7 @@ package terminator
|
|||
import (
|
||||
"io"
|
||||
|
||||
pngstructure "github.com/superseriousbusiness/go-png-image-structure/v2"
|
||||
pngstructure "codeberg.org/superseriousbusiness/go-png-image-structure/v2"
|
||||
)
|
||||
|
||||
type pngVisitor struct {
|
||||
|
|
|
|||
4
vendor/codeberg.org/superseriousbusiness/exif-terminator/terminator.go
generated
vendored
4
vendor/codeberg.org/superseriousbusiness/exif-terminator/terminator.go
generated
vendored
|
|
@ -25,8 +25,8 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
|
||||
jpegstructure "github.com/superseriousbusiness/go-jpeg-image-structure/v2"
|
||||
pngstructure "github.com/superseriousbusiness/go-png-image-structure/v2"
|
||||
jpegstructure "codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2"
|
||||
pngstructure "codeberg.org/superseriousbusiness/go-png-image-structure/v2"
|
||||
)
|
||||
|
||||
func Terminate(in io.Reader, mediaType string) (io.Reader, error) {
|
||||
|
|
|
|||
7
vendor/codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2/README.md
generated
vendored
Normal file
7
vendor/codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
**Forked from https://github.com/dsoprea/go-jpeg-image-structure**
|
||||
|
||||
## Overview
|
||||
|
||||
Parse raw JPEG data into individual segments of data. You can print or export this data, including hash digests for each. You can also parse/modify the EXIF data and write an updated image.
|
||||
|
||||
EXIF, XMP, and IPTC data can also be extracted. The provided CLI tool can print this data as well.
|
||||
|
|
@ -248,12 +248,30 @@ func (c *Chunk) Bytes() ([]byte, error) {
|
|||
if len(c.Data) != int(c.Length) {
|
||||
return nil, errors.New("length of data not correct")
|
||||
}
|
||||
b := make([]byte, 0, 4+4+c.Length+4)
|
||||
b = binary.BigEndian.AppendUint32(b, c.Length)
|
||||
b = append(b, c.Type...)
|
||||
b = append(b, c.Data...)
|
||||
b = binary.BigEndian.AppendUint32(b, c.Crc)
|
||||
return b, nil
|
||||
|
||||
preallocated := make([]byte, 0, 4+4+c.Length+4)
|
||||
b := bytes.NewBuffer(preallocated)
|
||||
|
||||
err := binary.Write(b, binary.BigEndian, c.Length)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if _, err := b.Write([]byte(c.Type)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if c.Data != nil {
|
||||
if _, err := b.Write(c.Data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if err := binary.Write(b, binary.BigEndian, c.Crc); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return b.Bytes(), nil
|
||||
}
|
||||
|
||||
// Write encodes and writes the bytes for this chunk.
|
||||
|
|
@ -262,37 +280,23 @@ func (c *Chunk) WriteTo(w io.Writer) (int, error) {
|
|||
return 0, errors.New("length of data not correct")
|
||||
}
|
||||
|
||||
var n int
|
||||
|
||||
b := make([]byte, 4) // uint32 buf
|
||||
|
||||
binary.BigEndian.PutUint32(b, c.Length)
|
||||
if nn, err := w.Write(b); err != nil {
|
||||
return n + nn, err
|
||||
if err := binary.Write(w, binary.BigEndian, c.Length); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
n += len(b)
|
||||
|
||||
if nn, err := io.WriteString(w, c.Type); err != nil {
|
||||
return n + nn, err
|
||||
if _, err := w.Write([]byte(c.Type)); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
n += len(c.Type)
|
||||
|
||||
if nn, err := w.Write(c.Data); err != nil {
|
||||
return n + nn, err
|
||||
if _, err := w.Write(c.Data); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
n += len(c.Data)
|
||||
|
||||
binary.BigEndian.PutUint32(b, c.Crc)
|
||||
if nn, err := w.Write(b); err != nil {
|
||||
return n + nn, err
|
||||
if err := binary.Write(w, binary.BigEndian, c.Crc); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
n += len(b)
|
||||
|
||||
return n, nil
|
||||
return 4 + len(c.Type) + len(c.Data) + 4, nil
|
||||
}
|
||||
|
||||
// readHeader verifies that the PNG header bytes appear next.
|
||||
10
vendor/github.com/superseriousbusiness/go-jpeg-image-structure/v2/README.md
generated
vendored
10
vendor/github.com/superseriousbusiness/go-jpeg-image-structure/v2/README.md
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
[](https://travis-ci.org/dsoprea/go-jpeg-image-structure/v2)
|
||||
[](https://codecov.io/gh/dsoprea/go-jpeg-image-structure)
|
||||
[](https://goreportcard.com/report/github.com/dsoprea/go-jpeg-image-structure/v2)
|
||||
[](https://godoc.org/github.com/dsoprea/go-jpeg-image-structure/v2)
|
||||
|
||||
## Overview
|
||||
|
||||
Parse raw JPEG data into individual segments of data. You can print or export this data, including hash digests for each. You can also parse/modify the EXIF data and write an updated image.
|
||||
|
||||
EXIF, XMP, and IPTC data can also be extracted. The provided CLI tool can print this data as well.
|
||||
14
vendor/modules.txt
vendored
14
vendor/modules.txt
vendored
|
|
@ -245,9 +245,15 @@ codeberg.org/superseriousbusiness/activity/streams/values/rfc2045
|
|||
codeberg.org/superseriousbusiness/activity/streams/values/rfc5988
|
||||
codeberg.org/superseriousbusiness/activity/streams/values/string
|
||||
codeberg.org/superseriousbusiness/activity/streams/vocab
|
||||
# codeberg.org/superseriousbusiness/exif-terminator v0.9.1
|
||||
# codeberg.org/superseriousbusiness/exif-terminator v0.10.0
|
||||
## explicit; go 1.21
|
||||
codeberg.org/superseriousbusiness/exif-terminator
|
||||
# codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2 v2.1.0-SSB
|
||||
## explicit; go 1.17
|
||||
codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2
|
||||
# codeberg.org/superseriousbusiness/go-png-image-structure/v2 v2.1.0-SSB
|
||||
## explicit; go 1.12
|
||||
codeberg.org/superseriousbusiness/go-png-image-structure/v2
|
||||
# codeberg.org/superseriousbusiness/httpsig v1.3.0-SSB
|
||||
## explicit; go 1.21
|
||||
codeberg.org/superseriousbusiness/httpsig
|
||||
|
|
@ -807,12 +813,6 @@ github.com/stretchr/testify/suite
|
|||
# github.com/subosito/gotenv v1.6.0
|
||||
## explicit; go 1.18
|
||||
github.com/subosito/gotenv
|
||||
# github.com/superseriousbusiness/go-jpeg-image-structure/v2 v2.0.0-20220321154430-d89a106fdabe
|
||||
## explicit; go 1.17
|
||||
github.com/superseriousbusiness/go-jpeg-image-structure/v2
|
||||
# github.com/superseriousbusiness/go-png-image-structure/v2 v2.0.1-SSB
|
||||
## explicit; go 1.12
|
||||
github.com/superseriousbusiness/go-png-image-structure/v2
|
||||
# github.com/superseriousbusiness/oauth2/v4 v4.3.2-SSB.0.20230227143000-f4900831d6c8
|
||||
## explicit; go 1.13
|
||||
github.com/superseriousbusiness/oauth2/v4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue