Perl 5.26 cannot read *.mpc files ?

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
Jeydee
Posts: 3
Joined: 2017-10-31T07:51:35-07:00
Authentication code: 1151

Perl 5.26 cannot read *.mpc files ?

Post by Jeydee »

Thanks for adding me, i found a problem.
I am sitting over 2 years in my free time on a graphics program written in Perl/Tk.
It's for Web Galleries, Image Processing, Animations, Batch Processing... on Linux.
If you are interesting have a look at http://www.jeydee.net/gallerymaker/index.html
For Image Processing i am using often the commandline insteed of the Perl API
like system("convert blabla tempfile.mpc") and storing the tempfiles for speed in the *.mpc format.
A few days ago i udated my Ubuntu from 17.04 to 17.10.
Perl was also updated from Perl 5.24 to Perl 5.26 and ImageMagick to 8:6.9.7.4.
Suddenly some parts of my program don't work. I found that he cannot read the data from the *.mpc file into the
IM Object like $p = Image::Magick->new(@imlimit); $p->Read($tempfile);
The first 1-2 times it works and than not. I was reading the Perl changelog and there was many optimizations
on arrays, hashes, reading files (streaming) ...
I don't now what happen, on Perl 5.20, 5.22 and 5.24 it works perfectly but not on 5.26.
I am not shure is this a problem on IM or Perl.
Yesterday i found a solution, changing all tempfiles from *.mpc to *.miff and all works fine again.
Is this a problem on me or IM or Perl ?
Thanks for watching and your great work on IM.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Perl 5.26 cannot read *.mpc files ?

Post by snibgo »

MPC files are essentially memory dumps, so the format often changes with new versions of IM. After writing a MPC, you should use the same version to read it.

MIFF files are independent of versions. You can write with one version and read with another.
snibgo's IM pages: im.snibgo.com
Jeydee
Posts: 3
Joined: 2017-10-31T07:51:35-07:00
Authentication code: 1151

Re: Perl 5.26 cannot read *.mpc files ?

Post by Jeydee »

Thanks for the answer, i know that mpc are memory dumps. I am using it for temporary files, after using they are deleted. So the IM version is always the same on read and write, no storage for a longer time. What I did not know is that the format with the IM version changes. Ok thanks, i am using .miff in the future.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Perl 5.26 cannot read *.mpc files ?

Post by fmw42 »

There were a few release at one point where the MPC files if saved to disk disappeared. I had that problem. But it has since been resolved. You might want to upgrade, if the version issue does not bother you.
Jeydee
Posts: 3
Joined: 2017-10-31T07:51:35-07:00
Authentication code: 1151

Re: Perl 5.26 cannot read *.mpc files ?

Post by Jeydee »

Hi, ok different IM versions is possible.
I have tested this on several computers, the effect is reproducible always the same.
Debian stable, Debian testing, Ubuntu 17.04 and Ubuntu 17.10 use the same IM version 6.9.7.4.
The MPC file has not disappeared either, I can read it with display-im6 and the content is correct.
Only when I read it through Perl the data is lost.
This effect only occurs with Debian testing and Ubuntu 17.10, the older versions work.
The only difference I see is that Debian testing and Ubuntu 17.10 use Perl 5.26 instead of 5.24.
Thanks ..
Post Reply