diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py index d1d4d2b90..1252c3843 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py +++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py @@ -1,4 +1,4 @@ -# Copyright 2018-2019 The glTF-Blender-IO authors. +# Copyright 2018-2020 The glTF-Blender-IO authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -101,9 +101,14 @@ def __gather_mime_type(sockets_or_slots, export_image, export_settings): if export_settings["gltf_image_format"] == "AUTO": image = export_image.blender_image() - if image is not None and __is_blender_image_a_jpeg(image): - return "image/jpeg" - return "image/png" + if image is not None: + return "image/jpeg" if __is_blender_image_a_jpeg(image) else "image/png" + for fill in export_image.fills.values(): + if not isinstance(fill, FillImage): + continue + if not __is_blender_image_a_jpeg(fill.image): + return "image/png" + return "image/jpeg" elif export_settings["gltf_image_format"] == "JPEG": return "image/jpeg"