def __get_temp_tiff_image_path(self, image): tiff_image_path = utils.get_path_with_new_extension(image.filepath, "tif") tiff_image_absolute_path = utils.get_absolute_path(tiff_image_path) tiff_file_name = os.path.basename(tiff_image_path) tmp_file_path = os.path.join(self.__tmp_dir, tiff_file_name) if tiff_image_path != image.filepath: self.__save_as_tiff(image, tmp_file_path) self.__tmp_images[tmp_file_path] = (tiff_image_absolute_path) return tmp_file_path
def __get_temp_tiff_image_path(self, image): # check if the image already is a .tif image_extension = utils.get_extension_from_path(image.filepath) cbPrint(image_extension) if ".tif" == image_extension: cbPrint("Image {!r} is already a tif, not converting".format(image.name), "debug") return image.filepath tiff_image_path = utils.get_path_with_new_extension(image.filepath, "tif") tiff_image_absolute_path = utils.get_absolute_path(tiff_image_path) tiff_file_name = os.path.basename(tiff_image_path) tmp_file_path = os.path.join(self.__tmp_dir, tiff_file_name) if tiff_image_path != image.filepath: self.__save_as_tiff(image, tmp_file_path) self.__tmp_images[tmp_file_path] = tiff_image_absolute_path return tmp_file_path
def __get_temp_tiff_image_path(self, image): # check if the image already is a .tif image_extension = utils.get_extension_from_path(image.filepath) cbPrint(image_extension) if ".tif" == image_extension: cbPrint("Image {!r} is already a tif, not converting".format(image.name), 'debug') return image.filepath tiff_image_path = utils.get_path_with_new_extension(image.filepath, "tif") tiff_image_absolute_path = utils.get_absolute_path(tiff_image_path) tiff_file_name = os.path.basename(tiff_image_path) tmp_file_path = os.path.join(self.__tmp_dir, tiff_file_name) if tiff_image_path != image.filepath: self.__save_as_tiff(image, tmp_file_path) self.__tmp_images[tmp_file_path] = (tiff_image_absolute_path) return tmp_file_path