Skip to content

Commit

Permalink
Move SetResourceLimit to package level
Browse files Browse the repository at this point in the history
Move the SetResourceLimit function from the MagickWand type to the
package level.

This does the same as MR #139 but for the ImageMagick 7.
  • Loading branch information
coderkun authored and justinfx committed May 20, 2024
1 parent be2238a commit fe73fb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions imagick/magick_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ func GetVersion() (version string, nversion uint) {
nversion = uint(cnver)
return
}

// Specify resource limit at package level.
func SetResourceLimit(rtype ResourceType, limit uint64) bool {
ok := C.MagickSetResourceLimit(C.ResourceType(rtype), C.MagickSizeType(limit))
return C.int(ok) == 1
}
6 changes: 0 additions & 6 deletions imagick/magick_wand_prop.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,6 @@ func (mw *MagickWand) SetPointsize(pointSize float64) error {
return mw.getLastErrorIfFailed(ok)
}

// SetResourceLimit Sets the limit for a particular resource in megabytes.
func (mw *MagickWand) SetResourceLimit(rtype ResourceType, limit int64) error {
ok := C.MagickSetResourceLimit(C.ResourceType(rtype), C.MagickSizeType(limit))
return mw.getLastErrorIfFailed(ok)
}

// SetResolution Sets the image resolution.
func (mw *MagickWand) SetResolution(xRes, yRes float64) error {
ok := C.MagickSetResolution(mw.mw, C.double(xRes), C.double(yRes))
Expand Down

0 comments on commit fe73fb6

Please sign in to comment.