diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 30322b3..b959084 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -69,7 +69,7 @@ jobs: - name: Conan install run: | - conan install . --build=missing -i build -s build_type=Release -s compiler="Visual Studio" + conan install . -i build -s build_type=Release -s compiler="Visual Studio" --build missing shell: cmd - name: Conan build @@ -171,7 +171,7 @@ jobs: - name: Conan install run: | - conan install . -i build -s build_type=Release --build fmt -s compiler.libcxx=libstdc++11 + conan install . -i build -s build_type=Release --build fmt -s compiler.libcxx=libstdc++11 --build missing shell: bash - name: Conan build @@ -276,7 +276,7 @@ jobs: - name: Conan install run: | - env CMAKE_OSX_ARCHITECTURES=x86_64 conan install . -i build -s build_type=Release --build missing --settings arch=x86_64 + env CMAKE_OSX_ARCHITECTURES=x86_64 conan install . -i build -s build_type=Release --settings arch=x86_64 --build missing shell: bash - name: Conan build diff --git a/src/gltf/TextureBuilder.cpp b/src/gltf/TextureBuilder.cpp index 0a930dc..e626a43 100644 --- a/src/gltf/TextureBuilder.cpp +++ b/src/gltf/TextureBuilder.cpp @@ -118,24 +118,15 @@ std::shared_ptr TextureBuilder::combine( } } - // write a .png iff we need transparency in the destination texture - bool png = includeAlphaChannel; - std::vector imgBuffer; - int res; - if (png) { - res = stbi_write_png_to_func( - WriteToVectorContext, - &imgBuffer, - width, - height, - channels, - mergedPixels.data(), - width * channels); - } else { - res = stbi_write_jpg_to_func( - WriteToVectorContext, &imgBuffer, width, height, channels, mergedPixels.data(), 80); - } + int res = stbi_write_png_to_func( + WriteToVectorContext, + &imgBuffer, + width, + height, + channels, + mergedPixels.data(), + width * channels); if (!res) { fmt::printf("Warning: failed to generate merge texture '%s'.\n", mergedFilename); return nullptr; @@ -145,9 +136,9 @@ std::shared_ptr TextureBuilder::combine( if (options.outputBinary && !options.separateTextures) { const auto bufferView = gltf.AddRawBufferView(*gltf.defaultBuffer, imgBuffer.data(), to_uint32(imgBuffer.size())); - image = new ImageData(mergedName, *bufferView, png ? "image/png" : "image/jpeg"); + image = new ImageData(mergedName, *bufferView, "image/png"); } else { - const std::string imageFilename = mergedFilename + (png ? ".png" : ".jpg"); + const std::string imageFilename = mergedFilename + (".png"); const std::string imagePath = outputFolder + imageFilename; FILE* fp = fopen(imagePath.c_str(), "wb"); if (fp == nullptr) {