Show
Ignore:
Timestamp:
09/10/09 16:10:14 (6 months ago)
Author:
cristy
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ImageMagick/trunk/magick/cache.c

    r32 r36  
    14721472    type; 
    14731473 
     1474  MapMode 
     1475    mode; 
     1476 
    14741477  assert(cache != (Cache) NULL); 
    14751478  cache_info=(CacheInfo *) cache; 
     
    14891492    (void) DeleteNodeByValueFromSplayTree(cache_resources,cache_info); 
    14901493  type=cache_info->type; 
     1494  mode=cache_info->mode; 
    14911495  RelinquishPixelCachePixels(cache_info); 
    1492   if ((type == MapCache) || (type == DiskCache)) 
     1496  if ((mode != ReadMode) && ((type == MapCache) || (type == DiskCache))) 
    14931497    (void) RelinquishUniqueFileResource(cache_info->cache_filename); 
    14941498  *cache_info->cache_filename='\0'; 
     
    21002104  destroy=MagickFalse; 
    21012105  (void) LockSemaphoreInfo(cache_info->semaphore); 
    2102   if (cache_info->reference_count > 1) 
     2106  if ((cache_info->reference_count > 1) || (cache_info->mode == ReadMode)) 
    21032107    { 
    21042108      Image 
     
    40994103%    o filename: the persistent pixel cache filename. 
    41004104% 
     4105%    o attach: A value other than zero initializes the persistent pixel 
     4106%      cache. 
     4107% 
    41014108%    o initialize: A value other than zero initializes the persistent pixel 
    41024109%      cache. 
     
    41444151    { 
    41454152      /* 
    4146         Attach persistent pixel cache. 
     4153        Attach existing persistent pixel cache. 
    41474154      */ 
    41484155      if (image->debug != MagickFalse) 
     
    41554162      if (OpenPixelCache(image,ReadMode,exception) == MagickFalse) 
    41564163        return(MagickFalse); 
    4157       cache_info=(CacheInfo *) ReferencePixelCache(cache_info); 
    41584164      *offset+=cache_info->length+pagesize-(cache_info->length % pagesize); 
    41594165      return(MagickTrue); 
    41604166    } 
    4161   if ((cache_info->type != MemoryCache) && (cache_info->reference_count == 1)) 
     4167  if ((cache_info->mode != ReadMode) && (cache_info->type != MemoryCache) && 
     4168      (cache_info->reference_count == 1)) 
    41624169    { 
    41634170      (void) LockSemaphoreInfo(cache_info->semaphore); 
    4164       if ((cache_info->type != MemoryCache) && 
     4171      if ((cache_info->mode != ReadMode) && (cache_info->type != MemoryCache) && 
    41654172          (cache_info->reference_count == 1)) 
    41664173        { 
     
    41694176 
    41704177          /* 
    4171             Usurp resident persistent pixel cache. 
     4178            Usurp existing persistent pixel cache. 
    41724179          */ 
    41734180          status=rename(cache_info->cache_filename,filename); 
     
    41894196    } 
    41904197  /* 
    4191     Attach persistent pixel cache. 
     4198    Clone persistent pixel cache. 
    41924199  */ 
    41934200  clone_image=(*image);