Skip to content

Commit

Permalink
- fix potential leak in find_trim(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
elad laufer committed Dec 6, 2021
1 parent 602780f commit 805153a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion vips/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,12 @@ func (r *ImageRef) OptimizeICCProfile() error {

embedded := r.HasICCProfile() && (inputProfile == "")

out, err := vipsICCTransform(r.image, r.optimizedIccProfile, inputProfile, IntentPerceptual, 0, embedded)
depth := 16
if r.BandFormat() == BandFormatUchar || r.BandFormat() == BandFormatChar || r.BandFormat() == BandFormatNotSet {
depth = 8
}

out, err := vipsICCTransform(r.image, r.optimizedIccProfile, inputProfile, IntentPerceptual, depth, embedded)
if err != nil {
govipsLog("govips", LogLevelError, fmt.Sprintf("failed to do icc transform: %v", err.Error()))
return err
Expand Down

0 comments on commit 805153a

Please sign in to comment.