diff options
| author | 2022-08-10 14:10:46 +0200 | |
|---|---|---|
| committer | 2022-08-10 14:10:46 +0200 | |
| commit | 2462c5fe224ee57d13f8e9cecb26e674df0f7985 (patch) | |
| tree | 44b972b23f9967d70a99c69629283efa9413a589 /vendor/github.com/superseriousbusiness/exif-terminator/terminator.go | |
| parent | [bugfix] Fix thumbnails not taking exif rotation into account (#746) (diff) | |
| download | gotosocial-2462c5fe224ee57d13f8e9cecb26e674df0f7985.tar.xz | |
[chore] bump exif-terminator to 0.4.0 (#747)
Diffstat (limited to 'vendor/github.com/superseriousbusiness/exif-terminator/terminator.go')
| -rw-r--r-- | vendor/github.com/superseriousbusiness/exif-terminator/terminator.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/superseriousbusiness/exif-terminator/terminator.go b/vendor/github.com/superseriousbusiness/exif-terminator/terminator.go index 0eb46ea9f..575bb1e42 100644 --- a/vendor/github.com/superseriousbusiness/exif-terminator/terminator.go +++ b/vendor/github.com/superseriousbusiness/exif-terminator/terminator.go @@ -42,7 +42,7 @@ func Terminate(in io.Reader, fileSize int, mediaType string) (io.Reader, error) switch mediaType { case "image/jpeg", "jpeg", "jpg": - err = terminateJpeg(scanner, pipeWriter) + err = terminateJpeg(scanner, pipeWriter, fileSize) case "image/png", "png": // for pngs we need to skip the header bytes, so read them in // and check we're really dealing with a png here @@ -65,10 +65,11 @@ func Terminate(in io.Reader, fileSize int, mediaType string) (io.Reader, error) return pipeReader, err } -func terminateJpeg(scanner *bufio.Scanner, writer io.WriteCloser) error { +func terminateJpeg(scanner *bufio.Scanner, writer io.WriteCloser, expectedFileSize int) error { // jpeg visitor is where the spicy hack of streaming the de-exifed data is contained v := &jpegVisitor{ - writer: writer, + writer: writer, + expectedFileSize: expectedFileSize, } // provide the visitor to the splitter so that it triggers on every section scan |
