Merge remote-tracking branch 'origin/blender-v3.6-release' into main
This commit is contained in:
@@ -109,7 +109,8 @@ ExternalProject_Add(external_openimageio
|
||||
PREFIX ${BUILD_DIR}/openimageio
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio.diff &&
|
||||
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/oiio_3832.diff &&
|
||||
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/oiio_deadlock.diff
|
||||
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/oiio_deadlock.diff &&
|
||||
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/oiio_psd_8da473e254.diff
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/openimageio
|
||||
)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
diff --git a/src/psd.imageio/psdinput.cpp b/src/psd.imageio/psdinput.cpp
|
||||
index 9dc240281..05b008e0a 100644
|
||||
--- a/src/psd.imageio/psdinput.cpp
|
||||
+++ b/src/psd.imageio/psdinput.cpp
|
||||
@@ -1344,9 +1344,27 @@ PSDInput::load_resource_thumbnail(uint32_t length, bool isBGR)
|
||||
if (!ioread(&jpeg_data[0], jpeg_length))
|
||||
return false;
|
||||
|
||||
+ // Create an IOMemReader that references the thumbnail JPEG blob and read
|
||||
+ // it with an ImageInput, into the memory owned by an ImageBuf.
|
||||
Filesystem::IOMemReader thumbblob(jpeg_data.data(), jpeg_length);
|
||||
- m_thumbnail = ImageBuf("thumbnail.jpg", 0, 0, nullptr, nullptr, &thumbblob);
|
||||
- m_thumbnail.read(0, 0, true);
|
||||
+ m_thumbnail.clear();
|
||||
+ auto imgin = ImageInput::open("thumbnail.jpg", nullptr, &thumbblob);
|
||||
+ if (imgin) {
|
||||
+ ImageSpec spec = imgin->spec(0);
|
||||
+ m_thumbnail.reset(spec, InitializePixels::No);
|
||||
+ ok = imgin->read_image(0, 0, 0, m_thumbnail.spec().nchannels,
|
||||
+ m_thumbnail.spec().format,
|
||||
+ m_thumbnail.localpixels());
|
||||
+ imgin.reset();
|
||||
+ } else {
|
||||
+ errorfmt("Failed to open thumbnail");
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!ok) {
|
||||
+ errorfmt("Failed to read thumbnail: {}", m_thumbnail.geterror());
|
||||
+ m_thumbnail.clear();
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
// Set these attributes for the merged composite only (subimage 0)
|
||||
composite_attribute("thumbnail_width", (int)m_thumbnail.spec().width);
|
||||
Reference in New Issue
Block a user