-- isDuplicate  -- CBT: 10.03.2001
--
on isDuplicate thisMem, thatMem
  
  -- To save some time, we'll check the obvious properties, 
  -- before checking image data.
  
  if thisMem.type <> #bitmap then return FALSE
  if thisMem.rect <> thatMem.rect then return FALSE
  if thisMem.regpoint <> thatMem.regpoint then return FALSE
  if thisMem.depth <> thatMem.depth then return FALSE
  
  -- If none of the obvious properties are different, 
  -- then we need to compare images.
  
  workingImage = thisMem.image.duplicate()
  workingImage.copyPixels(thatMem.image, thatMem.rect, thatMem.rect,\
  [#ink:#reverse])  
  
  trimmedImage = workingImage.trimWhitespace()
  
  return trimmedImage.width=0 and trimmedImage.height=0
  
end