You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that I am using the latest version of ImageMagick
I have searched open and closed issues to ensure it has not already been reported
Description
As a side effect, the changeset f39f646 made the MapCache allocation code unreachable. This issue also has the consequence of disabling multi-threading with OpenMP enabled algorithms because of the preliminary check on the type of cache of the images being manipulated.
Steps to Reproduce
Compile and run the following code using 6.9.9-27 (last good) and 6.9.9-28 (first bad)
#include <Magick++.h>
#include <iostream>
using namespace std;
using MagickCore::Quantum;
// test for the regression introduced along with f39f6469665edda3e43f05ba8ef2e9651222ddad
// $ g++ test.cpp -o test `pkg-config --libs --cflags Magick++` && ./test
void setConfiguration() {
Magick::ResourceLimits::area(1024*1024);
// small value to prevent the use of the MemoryCache
Magick::ResourceLimits::memory(100);
// Expects that images are allocated from the MapCache
Magick::ResourceLimits::map(4*sizeof(QuantumRange)*1024*1024);
Magick::ResourceLimits::disk(4*sizeof(QuantumRange)*1024*1024);
}
void printConfiguration() {
cout << "Configuration:" << endl
<< "- Area: " << Magick::ResourceLimits::area() << endl
<< "- Memory: " << Magick::ResourceLimits::memory() << endl
<< "- Map: " << Magick::ResourceLimits::map() << endl
<< "- Disk: " << Magick::ResourceLimits::disk() << endl;
}
void printUsage(const char *when) {
cout << "Usage " << when << ":" << endl
<< "- Area: " << MagickCore::GetMagickResource(MagickCore::AreaResource) << endl
<< "- Memory: " << MagickCore::GetMagickResource(MagickCore::MemoryResource) << endl
<< "- Map: " << MagickCore::GetMagickResource(MagickCore::MapResource) << endl
<< "- Disk: " << MagickCore::GetMagickResource(MagickCore::DiskResource) << endl;
}
int main(int argc, char **argv) {
Magick::InitializeMagick(*argv);
setConfiguration();
printConfiguration();
printUsage("before");
Magick::Image image(Magick::Geometry(1000,1000), Magick::Color(0,0,0));
printUsage("after");
if (MagickCore::GetImagePixelCacheType(const_cast<Magick::Image&>(image).image())
== MagickCore::MapCache) {
cout << "Good! pixel cache type is MapCache" << endl;
return 0;
}
cerr << "Not good! pixel cache is not MapCache" << endl;
return 1;
}
The text was updated successfully, but these errors were encountered:
ploki
added a commit
to ploki/ImageMagick6
that referenced
this issue
Sep 8, 2020
Prerequisites
Description
As a side effect, the changeset f39f646 made the MapCache allocation code unreachable. This issue also has the consequence of disabling multi-threading with OpenMP enabled algorithms because of the preliminary check on the type of cache of the images being manipulated.
Steps to Reproduce
Compile and run the following code using 6.9.9-27 (last good) and 6.9.9-28 (first bad)
The text was updated successfully, but these errors were encountered: