-
Notifications
You must be signed in to change notification settings - Fork 66
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
Different results from same code #171
Comments
It would be a bug in the version of imagemagick that we ship with the CRAN package. To narrow it down would it be possible to test this with another version of imagemagick? E.g. on macos you can do:
And then install.packages("magick", type = 'source') Or alternatively try on Windows or Linux. If the problem does not appear here, then It was likely a bug in imagemagick and I can easily fix it by upgrading the version of imagemagick that we ship on CRAN for the macos package. |
I tried the code on an older PC, and it worked. I also removed magick, then installed imagemagick@6, and then installed magick from source on the low-performance mac, using:
So far, it appears that imagemagick@6 solved the issue. However, I do need to be able to do annotations, and brew didn't accept the formula to include fontconfig:
|
Do they get cleaned when you run |
gc() removed only one file. |
Can you recommend any way to get imagemagick@6 working with annotations, or alternatively another version of image magick that might both solve the problem and have font support? |
It looks like homebrew is no longer supporting formula for imagemagick: "Usage of options has been discontinued in homebrew-core as it created a higher support burden than it provided benefits." https://discourse.brew.sh/t/imagemagick-formula-not-working/4034/3 |
I've removed magick and imagemagick, and reinstalled imagemagick using macports It put 6.9.9.40 on my machine. I then reinstalled magick from source and it links correctly to imagemagick and has the fontconfig and freetype features enabled (necessary for my project). But, I stilll have the same problem. Generating tons of 1.1 GB files, sometimes produces a result, most of the time does not. gc() does seem to collect all the recent files now. I've attempted putting gc() in a loop where I'm compositing the graphics, but it seems to delete files that R/magick isn't actually done with and I get errors: I've also attempted manually deleting the oldest temp files as new ones are being generated, and that seems to allow the process to work (still takes several minutes to do 12 composites). I"m nearing panic mode here as I am dependent on r magick to be able to complete this project which was due to the client a few days ago. My thoughts - is there a better way to delete the older temp files (without deleting the ones actually needed)? Is there are reason that I"m getting 1.1 GB temp files generated for a PNG that ends up only being < 1 MB? |
Yes, I did try with imagemagick 7.
Thanks,
Jon
…--
Jonathan Zadra, PhD
Director of Data Science
Sorenson Impact Center
David Eccles School of Business, University of Utah
(801) 581-4815
[email protected]
www.sorensonimpact.com
On Feb 15, 2019, 5:46 AM -0700, Jeroen Ooms ***@***.***>, wrote:
@jzadra did you try it with imagemagick7? Just use
brew install imagemagick
And then install.packages("magick", type = "source")
@dlemstra do you have any guess why these huge temporary files are created?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
--
|
@jeroen Those temporary files are created when there is not enough memory for the pixels. It will swap to disk instead then. |
@dlemstra the problem is that sometimes they don't seem to get cleaned up. I will have finished an image magick operation and the files are still there. |
Tracking the tempfile / gc issue here: #194 If other problems persist, please open a new issue (specific for each problem). |
…ound taken This is also an opportunity to link to the relevant GitHub issues and Bioc-devel threads. Cropping images through `magick::image_trim()` as done by default by `BiocStyle::html_document()` can fail on Linux. This could be an ImageMagick issue or an issue about lack of resources. The full investigative report is at https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016650.html. This is related to: yihui/knitr#1785 (comment) yihui/knitr#1796 Bioconductor/BiocStyle#65 (comment) ropensci/magick#171 ropensci/magick#194 In regionReport version 1.21.10 I have opted by using `crop = NULL` to disable cropping of images by `BiocStyle::html_document()` and thus avoid the issues with `ImageMagick` either coming from `magick`, from the version of `ImageMagick` installed on the Linux Bioconductor build machine and devel docker, or from resources in these two Linux environments as described in the investigative report. About a month ago I also saw failures on Windows on Bioc 3.10. Whether they were caused by ggbio 1.35.1 or this issue will remain a mystery. But it's likely that this `magick::image_trim()` issue also affected the Bioconductor windows builder. The related bioc-devel threads are: https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016538.html https://stat.ethz.ch/pipermail/bioc-devel/2020-March/016365.html
I'm having an issue where running the same code will sometimes produce the desired result, and other times just produce a blank white image of the correct dimensions.
I have a suspicion that it is a memory issue for the following reasons:
I am also experiencing problems where the R temp dir will fill up with magick temp files to the point of using all the drive's free space in case that is related.
So, if it is a memory issue, is there something I can adjust to eliminate this problem? If someone suspects a different issue, I can test. Please let me know what more info I can provide.
Here is file and the code:

The text was updated successfully, but these errors were encountered: