lib/DrawingUtils.js
function layerContainsImage (layer, imageUrl) {
  // Check the layer itself.
  if (layer.type === 'image' && layer.imageUrl === imageUrl) {
    return layer;
  }

  // Check the layer's children.
  if (layer.children) {
    for (var i=0, len=layer.children.length; i < len; i++) {
      if (layerContainsImage(layer.children[i], imageUrl)) {
        return layer.children[i];
      }
    }
  }

  return false;
}
function layerContainsImage (layer, imageUrl) {
  // Check the layer itself.
  if (layer.type === 'image' && layer.imageUrl === imageUrl) {
    return layer;
  }

  // Check the layer's children.
  if (layer.children) {
    for (var i=0, len=layer.children.length; i < len; i++) {
      if (layerContainsImage(layer.children[i], imageUrl)) {
        return layer.children[i];
      }
    }
  }

  return false;
}
function layerContainsImage ( layer , imageUrl ) { // Check the layer itself. if ( layer . type === 'image' && layer . imageUrl === imageUrl ) { return layer ; } // Check the layer's children. if ( layer . children ) { for ( var i = 0 , len = layer . children . length ; i < len ; i ++ ) { if ( layerContainsImage ( layer . children [ i ] , imageUrl ) ) { return layer . children [ i ] ; } } } return false ; }
Check if a layer is using a given image URL.

@param {RenderLayer} layer
@param {String} imageUrl
@return {Boolean}
Check if a layer is using a given image URL .