Cmake支持版本修改 Created-by: wxc397 Commit-by: fandongyu.30044153@huawei.com Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 * 3.2 数据库和部署说明 1. 常规更新 2. 重启unicorn 3. 重启sidekiq 4. 迁移任务:是否有迁移任务,没有写 "无" 5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无" * 3.4 其他技术优化内容(做了什么,变更了什么) - 重构了 xxxx 代码 - xxxx 算法优化 * 3.5 废弃通知(什么字段、方法弃用?) * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论: ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点: | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试: 性能测试: 并发测试: 其他: See merge request: openharmony/third_party_libtiff!38
libtiff
Original Repository: https://gitlab.com/libtiff/libtiff
This repository contains libtiff, a third-party open-source software used for reading, writing, and manipulating TIFF (Tagged Image File Format) images. It provides a standardized set of interfaces to handle various complex features of the TIFF format, including support for multiple compression algorithms (e.g., LZW, Deflate, JPEG, etc.). In OpenHarmony, libtiff primarily serves as a foundational component of the media subsystem, providing decoding capabilities for TIFF image formats.
Directory Structure
archive/ Past archived files
build/ Build helper scripts
cmake/ CMake build configuration files
contrib/ Non-core code contributed by the community
doc/ Documentation
libtiff/ Source code and header files for the libtiff core library
port/ Platform compatibility interface code
test/ Test scripts and cases
tools/ Source code for binary tools like tiffcp, tiffdump, etc.
README.md README instructions
How to Use libtiff in OpenHarmony
System components in OpenHarmony need to reference the libtiff component in BUILD.gn to use it.
// BUILD.gn
external_deps += [ "libtiff:libtiff" ]
Decoding Steps Using libtiff
- Open the file
TIFF *TIFFOpen(const char *filename, const char *mode);
filename: The name of the file
mode: The file opening mode ("r" for reading)
- Read image metadata
int TIFFGetField(TIFF *tif, uint32_t tag, ...);
tif:TIFF file context
tag:The metadata tag to read
...:Variable argument list to receive the tag value
Example:
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imgWidth);
- Decode the image
int TIFFReadRGBAImage(TIFF *tif, uint32_t width, uint32_t height, uint32_t *raster, int stopOnError);
tif:TIFF file context
width:Image width
height:Image height
raster:Memory address of the first pixel data after decoding
stopOnError:Error handling strategy. If non-zero, stop immediately on error; if zero, attempt to skip errors and continue decoding.
Example:
uint32_t *raster = (uint32_t *)_TIFFmalloc(width * height * sizeof(uint32_t));
if (raster != NULL) {
if (TIFFReadRGBAImage(tif, width, height, raster, 0)) {
// 解码成功,处理 raster 中的数据
}
_TIFFfree(raster);
}
- Close the file
void TIFFClose(TIFF *tif);
tif:TIFF file context
Feature Support
OpenHarmony currently integrates libtiff primarily for decoding and displaying TIFF images. Encoding (writing) of TIFF images and modification of metadata tags are not yet supported.
License
libtiff uses the LibTIFF License (a BSD-like license). See the LICENSE.md file in the root directory for details.