Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_image.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
index 8e441f9c..baee02bd 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
@@ -261,5 +261,8 @@ def __get_tex_from_socket(blender_shader_socket: bpy.types.NodeSocket, export_se
def __is_blender_image_a_jpeg(image: bpy.types.Image) -> bool:
if image.source != 'FILE':
return False
- path = image.filepath_raw.lower()
- return path.endswith('.jpg') or path.endswith('.jpeg') or path.endswith('.jpe')
+ if image.filepath_raw == '' and image.packed_file:
+ return image.packed_file.data[:3] == b'\xff\xd8\xff'
+ else:
+ path = image.filepath_raw.lower()
+ return path.endswith('.jpg') or path.endswith('.jpeg') or path.endswith('.jpe')