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

Add SetResourceLimit function (fixes #107) #139

Merged
merged 3 commits into from
Sep 30, 2017
Merged

Conversation

samt42
Copy link
Contributor

@samt42 samt42 commented Aug 14, 2017

Fix issue #107

add 'RESOURCE_WIDTH', 'RESOURCE_HEIGHT' Resource Type From C API
@samt42
Copy link
Contributor Author

samt42 commented Aug 14, 2017

Add ResourceType

@justinfx justinfx changed the title Fix issue #107 Add SetResourceLimit function (fixes #107) Aug 14, 2017

// Specify resource limit at package level.
func SetResourceLimit(rtype ResourceType, limit uint64) bool {
ok := C.MagickSetResourceLimit(C.ResourceType(rtype), C.MagickSizeType(limit))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to run gofmt on your source files before committing.

return false
} else {
return true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified to

return C.int(ok) == 1

@samt42
Copy link
Contributor Author

samt42 commented Sep 30, 2017

fixed

@justinfx justinfx merged commit 65098ff into gographics:master Sep 30, 2017
@justinfx
Copy link
Member

Thanks for the contribution and addressing the notes!

coderkun added a commit to coderkun/imagick that referenced this pull request May 20, 2024
Move the SetResourceLimit function from the MagickWand type to the
package level.

This does the same as MR gographics#139 but for the ImageMagick 7.
justinfx pushed a commit that referenced this pull request May 20, 2024
Move the SetResourceLimit function from the MagickWand type to the
package level.

This does the same as MR #139 but for the ImageMagick 7.
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

Successfully merging this pull request may close these issues.

None yet

2 participants