[chore] Update exif terminator version with codeberg libraries (#3855)

This commit is contained in:
tobi 2025-03-02 15:44:02 +01:00 committed by GitHub
parent 5d0e3d9c35
commit d8bb1c391b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 60 additions and 59 deletions

6
go.mod
View file

@ -29,7 +29,7 @@ require (
codeberg.org/gruf/go-storage v0.2.0
codeberg.org/gruf/go-structr v0.8.11
codeberg.org/superseriousbusiness/activity v1.12.0-gts
codeberg.org/superseriousbusiness/exif-terminator v0.9.1
codeberg.org/superseriousbusiness/exif-terminator v0.10.0
codeberg.org/superseriousbusiness/httpsig v1.3.0-SSB
github.com/DmitriyVTitov/size v1.5.0
github.com/KimMachineGun/automemlimit v0.7.1
@ -97,6 +97,8 @@ require (
codeberg.org/gruf/go-fastpath/v2 v2.0.0 // indirect
codeberg.org/gruf/go-mangler v1.4.1 // indirect
codeberg.org/gruf/go-maps v1.0.4 // indirect
codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2 v2.1.0-SSB // indirect
codeberg.org/superseriousbusiness/go-png-image-structure/v2 v2.1.0-SSB // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
@ -197,8 +199,6 @@ require (
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/superseriousbusiness/go-jpeg-image-structure/v2 v2.0.0-20220321154430-d89a106fdabe // indirect
github.com/superseriousbusiness/go-png-image-structure/v2 v2.0.1-SSB // indirect
github.com/tdewolff/parse/v2 v2.7.19 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/toqueteos/webbrowser v1.2.0 // indirect

12
go.sum generated
View file

@ -74,8 +74,12 @@ codeberg.org/gruf/go-structr v0.8.11 h1:I3cQCHpK3fQSXWaaUfksAJRN4+efULiuF11Oi/m8
codeberg.org/gruf/go-structr v0.8.11/go.mod h1:zkoXVrAnKosh8VFAsbP/Hhs8FmLBjbVVy5w/Ngm8ApM=
codeberg.org/superseriousbusiness/activity v1.12.0-gts h1:frNGTENLmOIQHKfOw/jj3UVj/GjHBljDx+CFAAK+m6Q=
codeberg.org/superseriousbusiness/activity v1.12.0-gts/go.mod h1:enxU1Lva4OcK6b/NBXscoHSEgEMsKJvdHrQFifQxp4o=
codeberg.org/superseriousbusiness/exif-terminator v0.9.1 h1:8Pss29AVuvljHAYLnZUyoqJp/8IN1cD3Jz30bJbxme8=
codeberg.org/superseriousbusiness/exif-terminator v0.9.1/go.mod h1:gCWKduudUWFzsnixoMzu0FYVdxHWG+AbXnZ50DqxsUE=
codeberg.org/superseriousbusiness/exif-terminator v0.10.0 h1:FiLX/AK07tzceS36I+kOP2aEH+aytjPSIlFoYePMEyg=
codeberg.org/superseriousbusiness/exif-terminator v0.10.0/go.mod h1:c/mCytx/+fisOZeVXtjCpXld/SeZb3VsD1vj3oPAihA=
codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2 v2.1.0-SSB h1:v2shEkOPgydTL0n44EFPsDT9dsEP7KRG85aPnojCYkI=
codeberg.org/superseriousbusiness/go-jpeg-image-structure/v2 v2.1.0-SSB/go.mod h1:Ba/VzIqzDHqqKk5jg+7uFpUsHmdDOsuWLodbamD80jU=
codeberg.org/superseriousbusiness/go-png-image-structure/v2 v2.1.0-SSB h1:Lqi70gvqNuHyik0gUNrBwElvFUP7A3W1FYLVV5lUmbQ=
codeberg.org/superseriousbusiness/go-png-image-structure/v2 v2.1.0-SSB/go.mod h1:99rP8gsZoCSUj+/lLdpV9+i86ujLdKSoUjvuxbgvN4M=
codeberg.org/superseriousbusiness/httpsig v1.3.0-SSB h1:0a2fQSgMZA3/k+zjb2Ot+kwzpWFHOVEGQR2t49NhglA=
codeberg.org/superseriousbusiness/httpsig v1.3.0-SSB/go.mod h1:mkfkHGdE2SCbNBHySjJZSDr3LHtwZb1Yjgc6GYPwAQM=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
@ -524,10 +528,6 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/superseriousbusiness/go-jpeg-image-structure/v2 v2.0.0-20220321154430-d89a106fdabe h1:ksl2oCx/Qo8sNDc3Grb8WGKBM9nkvhCm25uvlT86azE=
github.com/superseriousbusiness/go-jpeg-image-structure/v2 v2.0.0-20220321154430-d89a106fdabe/go.mod h1:gH4P6gN1V+wmIw5o97KGaa1RgXB/tVpC2UNzijhg3E4=
github.com/superseriousbusiness/go-png-image-structure/v2 v2.0.1-SSB h1:8psprYSK1KdOSH7yQ4PbJq0YYaGQY+gzdW/B0ExDb/8=
github.com/superseriousbusiness/go-png-image-structure/v2 v2.0.1-SSB/go.mod h1:ymKGfy9kg4dIdraeZRAdobMS/flzLk3VcRPLpEWOAXg=
github.com/superseriousbusiness/go-swagger v0.31.0-gts-go1.23-fix h1:CXcjArOyxBPFgsNAu4As+RK9BwOUEG1LL7ja4g7iax0=
github.com/superseriousbusiness/go-swagger v0.31.0-gts-go1.23-fix/go.mod h1:WSigRRWEig8zV6t6Sm8Y+EmUjlzA/HoaZJ5edupq7po=
github.com/superseriousbusiness/oauth2/v4 v4.3.2-SSB.0.20230227143000-f4900831d6c8 h1:nTIhuP157oOFcscuoK1kCme1xTeGIzztSw70lX9NrDQ=

View file

@ -23,7 +23,7 @@
"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{

View file

@ -21,7 +21,7 @@
import (
"io"
pngstructure "github.com/superseriousbusiness/go-png-image-structure/v2"
pngstructure "codeberg.org/superseriousbusiness/go-png-image-structure/v2"
)
type pngVisitor struct {

View file

@ -25,8 +25,8 @@
"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) {

View 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.

View file

@ -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.

View file

@ -1,10 +0,0 @@
[![Build Status](https://travis-ci.org/dsoprea/go-jpeg-image-structure/v2.svg?branch=master)](https://travis-ci.org/dsoprea/go-jpeg-image-structure/v2)
[![codecov](https://codecov.io/gh/dsoprea/go-jpeg-image-structure/branch/master/graph/badge.svg)](https://codecov.io/gh/dsoprea/go-jpeg-image-structure)
[![Go Report Card](https://goreportcard.com/badge/github.com/dsoprea/go-jpeg-image-structure/v2)](https://goreportcard.com/report/github.com/dsoprea/go-jpeg-image-structure/v2)
[![GoDoc](https://godoc.org/github.com/dsoprea/go-jpeg-image-structure/v2?status.svg)](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
View file

@ -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