-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
heif: add CreateCopy support (WIP) #8907
Conversation
03e6545
to
ad07518
Compare
frmts/heif/heifdrivercore.cpp
Outdated
@@ -42,33 +42,33 @@ int HEIFDriverIdentifySimplified(GDALOpenInfo *poOpenInfo) | |||
if (poOpenInfo->nHeaderBytes < 12 || poOpenInfo->fpL == nullptr) | |||
return false; | |||
|
|||
#if LIBHEIF_HAVE_VERSION(1, 4, 0) | |||
const auto res = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't call libheif file in this file, since for deferred loaded plugins (https://gdal.org/development/rfc/rfc96_deferred_plugin_loading.html), it will be linked into libgdal core, without libheif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Had not understood, and will need to review the RFC in detail to fix.
Based on an initial review of the RFC, I understand this is a filter that should return true for all supported files. That is, it is probably better to return a false positive (which will delay startup) than a false negative (which will cause the file not to be loaded), within reason. Clearly it needs to be a light test though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on an initial review of the RFC, I understand this is a filter that should return true for all supported files. That is, it is probably better to return a false positive (which will delay startup) than a false negative (which will cause the file not to be loaded), within reason.
yes.
If there are not-sure situations, and mostly if the file might be opened by another driver, you can also return GDAL_IDENTIFY_UNKNOWN, and the Open() method with be invoked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented. Additional RFC review to do.
3ac750b
to
a65fd32
Compare
The GDAL project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 28 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
If there are feedback items on what is currently implemented, that would be appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments, but looks good. Would need to be rebased on top of latest master to get fresh CI. Do you feel like this PR could be merged as it (with potential future PRs), or is there some extra work required?
Thanks.
I would not want to merge it without the test cases and documentation, or with the driver check hack. The other parts could probably wait for future PRs. |
Co-authored-by: Even Rouault <[email protected]>
Co-authored-by: Even Rouault <[email protected]>
fa17bec
to
2545967
Compare
2adfc1f
to
d1b3cd5
Compare
@@ -31,6 +34,26 @@ Driver capabilities | |||
|
|||
.. supports_virtualio:: if libheif >= 1.4 | |||
|
|||
Creation support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fix "AssertionError: Driver HEIF declares DCAP_CREATECOPY but doc does not!" in https://github.com/OSGeo/gdal/actions/runs/9139007180/job/25130835649?pr=8907:
Creation support | |
.. supports_createcopy:: | |
Creation support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Already fixed in a separate work branch. Still not sure what is going on with the bus error on the Alpine builds....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the Alpine builds....
perhaps a issue specific with the libheif version they ship
A way to reproduce locally is to use the Docker alpine:edge image
docker run --name gdal_alpine -it -v /path/to/your/GDAL/checkout:/gdal alpine:edge
execute the apk add line at https://github.com/OSGeo/gdal/blob/master/.github/workflows/alpine/Dockerfile.ci#L3
cd /gdal
python3 -m pip install --break-system-packages -U -r autotest/requirements.txt
mkdir build_alpine
cd build_alpine
do the build as in https://github.com/OSGeo/gdal/blob/master/.github/workflows/alpine/build.sh#L16 (drop the line "-DADD_EXTERNAL_DEFERRED_PLUGIN_FOO=/tmp/foo.cpp" to simplify things)
The GDAL project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 28 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 6 weeks. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the GDAL project can do to help push this PR forward please let us know how we can assist. |
I'll rework this and submit as a new PR. |
What does this PR do?
Implements CreateCopy for the heif driver. The implementation uses libheif.
This implementation also includes some cleanups to existing code. That could be split out into another PR if desired.
What are related issues/pull requests?
N/A.
Tasklist
Environment
N/A.