I would note that in this new pattern of derivative creation, the return value of $uploaded_file (7 lines above this one) is not tested for a FALSE value (presumably if the OBJ datastream didn't exist for some reason) before trying to use it.  The previous pattern did (https://github.com/Islandora/islandora_solution_pack_large_image/blob/7.x/includes/derivatives.inc#L482).