Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIPS-WARNING and corrupted image #434

Open
bellacbs opened this issue Nov 21, 2022 · 0 comments
Open

VIPS-WARNING and corrupted image #434

bellacbs opened this issue Nov 21, 2022 · 0 comments

Comments

@bellacbs
Copy link

bellacbs commented Nov 21, 2022

I'm converting some by compressing some images, but sometimes the alert appears:

(process:21837): VIPS-WARNING **: 10:16:34.520: read gave 149 warnings
(process:21837): VIPS-WARNING **: 10:16:34.530:

when this alert appears I notice that the compressed image has been corrupted
Does anyone know how I would capture this warning of a specific image for treatment using bimg or golang?

I'm using this code:

func compress(inputName string, outPutName string) error {
	options := bimg.Options{
		Type:    bimg.JPEG,
		Width:   480,
		Quality: 80,
	}

	buffer, err := bimg.Read(inputName)
	if err != nil {
		return err
	}

	newImage, err := bimg.NewImage(buffer).Process(options)
	if err != nil {
		return err
	}

	err = bimg.Write(outPutName, newImage)
	if err != nil {
		return err
	}
	return nil
}
@bellacbs bellacbs changed the title VIPS-WARNING and image failing VIPS-WARNING and corrupted image Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant