Page 1 of 1

Perl 5.26 cannot read *.mpc files ?

Posted: 2017-10-31T07:56:20-07:00
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.

Re: Perl 5.26 cannot read *.mpc files ?

Posted: 2017-10-31T08:14:42-07:00
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.

Re: Perl 5.26 cannot read *.mpc files ?

Posted: 2017-10-31T15:47:48-07:00
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.

Re: Perl 5.26 cannot read *.mpc files ?

Posted: 2017-10-31T15:59:39-07:00
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.

Re: Perl 5.26 cannot read *.mpc files ?

Posted: 2017-11-01T05:05:57-07:00
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 ..