Closed EmilDohne closed 8 months ago
When writing uneven files likely due to how we go from bbox coords to center coords (division) It writes out the extents incorrectly. e.g. when using the following code:
using namespace NAMESPACE_PSAPI; std::filesystem::path psb_path = std::filesystem::current_path(); psb_path += "\\Document.psb"; const uint32_t width = 63; const uint32_t height = 32; LayeredFile<bpp32_t> document = { Enum::ColorMode::RGB, width, height }; std::unordered_map <Enum::ChannelID, std::vector<bpp32_t>> channelMap; channelMap[Enum::ChannelID::Red] = std::vector<bpp32_t>(width * height, .25f); channelMap[Enum::ChannelID::Green] = std::vector<bpp32_t>(width * height, .25f); channelMap[Enum::ChannelID::Blue] = std::vector<bpp32_t>(width * height, .25f); ImageLayer<bpp32_t>::Params layerParams = {}; layerParams.layerName = "Layer"; layerParams.width = width; layerParams.height = height; auto layer = std::make_shared<ImageLayer<bpp32_t>>( std::move(channelMap), layerParams ); document.addLayer(layer); File::FileParams params = { .doRead = false, .forceOverwrite = true }; auto outputFile = File(psb_path, params); auto psdDocumentPtr = LayeredToPhotoshopFile(std::move(document)); psdDocumentPtr->write(outputFile);
It writes out the bbox as [0, 0, 32, 62] which is incorrect as it should be [0, 0, 32, 63] Please investigate
[0, 0, 32, 62]
[0, 0, 32, 63]
When writing uneven files likely due to how we go from bbox coords to center coords (division) It writes out the extents incorrectly. e.g. when using the following code:
It writes out the bbox as
[0, 0, 32, 62]
which is incorrect as it should be[0, 0, 32, 63]
Please investigate