Page 1 of 1
Error when reading from mpc
Posted: 2012-03-13T02:44:31-07:00
by kaigan
Hi!
I am doing several different transformations on a single source (e.g. different sizes of the source) and therefore I thought it be a good idea to store the original in a temporary mpc-file when processing to speed up the process a bit. However I get the following error when trying to read from the mpc-file:
Code: Select all
unable to persist pixel cache `/data/magick/magick-XXBqHuFC' @ mpc.c/ReadMPCImage/903
The folder /data/magick has all permissions set for the executing user. I've tried to search for a sollution but only found some irrelevant information.
The mpc-file is stored in a temporary file generated with tmpfile(). As such I'm using Imagick::readimagefile() to load the file. Can someone please help me? I'm using CentOS 6.2 with Imagick 3.1.0RC1 (I have tried with 3.0.1 as well) with Imagemagick 6.5.4.7-5.el6
Re: Error when reading from mpc
Posted: 2012-03-15T00:02:01-07:00
by anthony
NOTE a MPC: image is just a 'memory dump' of the image, which can be later directly 'paged-in' without needing parsing or decoding. It is already in memory format.
However MPC files are ONLY suitable for the exact ImageMagick program that produced it. Any re-compile of even the same version of ImageMagick, or even a MPC produced on another machine, will no work and at worse can cause a segmentation fault.
In summery. You can not use it for image storage of any appreciable amount of time
In other words it is only useful for temporary images, generally only for very short periods such as the life span of a specific program or script. Its advantage is it is very fast to write out, and read back in.
For more info see IM examples, File handling, MPC
http://www.imagemagick.org/Usage/files/#mpc
Re: Error when reading from mpc
Posted: 2012-03-15T00:44:04-07:00
by kaigan
anthony wrote:NOTE a MPC: image is just a 'memory dump' of the image, which can be later directly 'paged-in' without needing parsing or decoding. It is already in memory format.
However MPC files are ONLY suitable for the exact ImageMagick program that produced it. Any re-compile of even the same version of ImageMagick, or even a MPC produced on another machine, will no work and at worse can cause a segmentation fault.
In summery. You can not use it for image storage of any appreciable amount of time
In other words it is only useful for temporary images, generally only for very short periods such as the life span of a specific program or script. Its advantage is it is very fast to write out, and read back in.
For more info see IM examples, File handling, MPC
http://www.imagemagick.org/Usage/files/#mpc
Hi Anthony and thanks for your reply!
The thing is, we are using the mpc within the same process just a few seconds between reads and writes. If it that wouldn't be a suitable use for the MPC-format I don't know what is.
To clarify: I'm writing and reading the mpc-file from the same process, just different Imagick instances.
Re: Error when reading from mpc
Posted: 2012-03-15T21:59:17-07:00
by anthony
That should have no problems what so ever, and that is exactly how it is ment to be used.
I myself use it between seperate IM commands (from the same shell script)
What version of IM is it?
Note I can not run IMagick API myself.
Re: Error when reading from mpc
Posted: 2012-03-19T00:56:45-07:00
by kaigan
anthony wrote:That should have no problems what so ever, and that is exactly how it is ment to be used.
I myself use it between seperate IM commands (from the same shell script)
What version of IM is it?
Note I can not run IMagick API myself.
I'm running Imagemagick 6.5.4.7-5.el6 (also stated in my first post
).
Re: Error when reading from mpc
Posted: 2012-03-19T17:37:43-07:00
by anthony
It should have no problems.
Note MPC actually saves two files. one with meta-data, and a second larger file with the memory dump.
Make sure IM can write (and read) both files.