Skip to content
  • Michael Natterer's avatar
    libgimp: add gimp_layer,chanel,vectors,etc,_get_by_id() · fd5740e7
    Michael Natterer authored
    which call gimp_item_get_by_id() and additionally check if the
    returned item has the right type, and return NULL if not.
    
    This is both shorter and more readable than
    
    layer = GIMP_LAYER (gimp_item_get_by_id (id));
    
    and additionally makes sure we don't cast e.g. a non-layer with
    GIMP_LAYER(), which will give criticals but shouldn't, because the
    wrong IDs can come from anywhere and are an input problem and not a
    programming error (criticals are for programming errors).
    fd5740e7