Image-MetaData-JPEG
view release on metacpan or search on metacpan
lib/Image/MetaData/JPEG/Segment.pm view on Meta::CPAN
180181182183184185186187188189190191192193194195196197198199200# need being updated: the method returns immediately. #
# ------------------------------------------------------- #
# update() saves a reference to the old segment data area #
# and restores it if the specialised update routine fails.#
# This only generate a warning! Are there cleverer ways #
# to handle this case? It is however better to have a #
# corrupt object in memory, than a corrupt object written #
# over the original. Currently, this is restricted to the #
# possibility that an updated segment becomes too large. #
###########################################################
sub
update {
my
(
$this
) =
@_
;
# get the name of the segment
my
$name
=
$this
->{name};
# return immediately if this is an entropy-coded segment or
# past-the-end garbage. There is no need to "update" them
return
if
$name
=~ /ECS|Post-EOI/;
# if the segment was not correctly parsed, warn and return
$this
->
die
(
'This segment is faulty'
)
if
$this
->{error};
# this might come also from 'NOPARSE'
$this
->
die
(
'This segment has no records'
)
unless
@{
$this
->{records}};
( run in 0.491 second using v1.01-cache-2.11-cpan-49f99fa48dc )