GithubHelp home page GithubHelp logo

Comments (6)

DarthSim avatar DarthSim commented on May 28, 2024 2

Hey everyone!

Thanks for the sample! Should be fixed in the latest build.

from imgproxy.

dbackeus avatar dbackeus commented on May 28, 2024

We're also getting this error for quite a few tiff files.

Here is an example: https://drive.google.com/file/d/1mgyZP-loct-gKEzY0FVuvTy262AoWhhO/view?usp=sharing

Running vipsheader on it I get:
hwop6cu3s5ljmpmwabfe.tiff: 1549x933 uchar, 4 bands, cmyk, tiffload

Which appears to include the dimensions. Also MacOS preview can load the tiff just fine and it was possible to transform it on our previous asset hosting Cloudinary.

from imgproxy.

dbackeus avatar dbackeus commented on May 28, 2024

Oddly, when I tried adding a test for one of the broken tiffs on my MacBook it parsed the tiff just fine.

package imagemeta

import (
	"os"
	"path/filepath"
	"testing"

	"github.com/imgproxy/imgproxy/v3/imagetype"
	"github.com/stretchr/testify/require"
	"github.com/stretchr/testify/suite"
)

type TiffTestSuite struct {
	suite.Suite
}

func (s *TiffTestSuite) openFile(name string) *os.File {
	wd, err := os.Getwd()
	require.Nil(s.T(), err)
	path := filepath.Join(wd, "..", "testdata", name)
	f, err := os.Open(path)
	require.Nil(s.T(), err)
	return f
}

func (s *TiffTestSuite) TestDecodeTiffMeta1() {
	f := s.openFile("not-working.tiff")
	defer f.Close()

	metadata, err := DecodeTiffMeta(f)
	require.Nil(s.T(), err)
	require.Equal(
		s.T(),
		&meta{
			format: imagetype.TIFF,
			width:  213,
			height: 185,
		},
		metadata,
	)
}

func TestTiff(t *testing.T) {
	suite.Run(t, new(TiffTestSuite))
}

I also tried going through the whole processing pipeline via processing_handler_test.go which also didn't fail:

func (s *ProcessingHandlerTestSuite) TestTiffRequest() {
	rw := s.send("/unsafe/rs:fill:4:4/plain/local:///not-working.tiff")
	res := rw.Result()

	require.Equal(s.T(), 200, res.StatusCode)
	require.Equal(s.T(), "image/png", res.Header.Get("Content-Type"))

	meta, err := imagemeta.DecodeMeta(res.Body)

	require.Nil(s.T(), err)
	require.Equal(s.T(), imagetype.PNG, meta.Format())
	require.Equal(s.T(), 4, meta.Width())
	require.Equal(s.T(), 4, meta.Height())
}

Could this error be environment specific somehow?

We're running the imgproxy-pro:latest-ml container in Kubernetes via Talos Linux.

from imgproxy.

dbackeus avatar dbackeus commented on May 28, 2024

Just deployed the latest version.

So far so good 🙌

from imgproxy.

dbackeus avatar dbackeus commented on May 28, 2024

Can confirm no TIFF errors logged since the deploy 7 hours ago 🕺

from imgproxy.

mstaack avatar mstaack commented on May 28, 2024

confirmed..no issues since deploy :)
thanks

from imgproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.