Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CMYK color space for JPG images and fix the crash issues. #429

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevingpqi123
Copy link
Collaborator

No description provided.

@@ -180,6 +205,13 @@ bool JpegCodec::readPixels(const ImageInfo& dstInfo, void* dstPixels) const {
}
result = jpeg_finish_decompress(&cinfo);
} while (false);
if (cinfo.out_color_space == JCS_CMYK) {
int count = dstInfo.width() * dstInfo.height();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能用宽乘以高就作为size来遍历,rowBytes可能不等于宽度。

@@ -108,6 +108,28 @@ std::shared_ptr<ImageCodec> JpegCodec::MakeFromData(const std::string& filePath,
orientation, filePath, std::move(byteData)));
}

bool CMYKToColorType(uint32_t* dst, const uint32_t* src, int count, ColorType type) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

研究一下skcms那个第三方库有没有自带cmyk到其他格式的转换,用那个库的实现性能更好,有串行指令优化。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants