The output produced by previous versions of bmeps followed a scheme like
\begin{lstlisting}
/pstr 128 string def
/inputf currentfile /ASCII85Decode
filter /RunLengthDecode filter def
gsave
0 128 translate 128 128 scale
128 128 8 [128 0 0 -128 0 0] { inputf pstr readstring pop }
image
K)^H&K)^H&K)^H&K)^H&K)^H&K)^H&\,QR/mHa_*rrq/DNK'1UM#RM<Nr4k:
% .... weitere codierte Daten
K)`=[
~>
grestore
currentdict /inputf undef currentdict /pstr undef
\end{lstlisting}
Some PS instructions are placed behind the encoded image data. If there
is a problem during decoding the PS interpreter continues to scan for
instructions at the file position where image reading aborted.
No usefull PS instructions will be found, so the PS interpreter will stop
processing and issues an error message.

The ``filter'' instructions open files which are never closed (at least
not explicitly closed).
\clearpage
I compared bmeps output against the output of other programs producing
\textsc{eps}, especially jpeg2ps. Bmeps 2.0.0 now uses a scheme like:
\begin{lstlisting}
{
gsave
13 dict begin
/fa currentfile /ASCII85Decode filter def
/fb fa /FlateDecode filter def
/sr 128 string def /sg 128 string def /sb 128 string def
/DeviceRGB setcolorspace
0 128 translate 128 128 scale
<<
/ImageType 1
/Width 128 /Height 128 /ImageMatrix [128 0 0 -128 0 0]
/MultipleDataSources true
/DataSource [
{ fb sr readstring pop }
{ fb sg readstring pop }
{ fb sb readstring pop }
]
/BitsPerComponent 8
/Decode [0 1 0 1 0 1]
/Interpolate true
>>
image
fb closefile
fa flushfile fa closefile
end
grestore
} exec
J3Vsg3$]7K#D>EP:q1$o*=mro@So+\<\5,H7Uo<*jE<[.O@Wn[3@'nb-^757
?K;B=Q#WO;koDO!%M.<jFY8C$]2rn<?/*&:mfh[_=,uiX>KqH^7HqKeXM^,2
~>
\end{lstlisting}
Using ``\{ \ldots \} exec'' the PS interpreter first reads the
entire instruction set.
Cleanup (closing files, restoring the graphics state)
is done, no matter whether or not the image data was
decoded successfully or not.
All files are closed, the ``flushfile'' instructions ``eats up'' the
data on the level of the lowest filter file object until the
\textsc{eod} marker ``\textasciitilde{}>'' is found.
\clearpage
