Skip to content

build(install): include MSVC Debug pdb files in install stage - #199

Closed
haobinnan wants to merge 1 commit into
danoli3:masterfrom
haobinnan:master
Closed

haobinnan wants to merge 1 commit into
danoli3:masterfrom
haobinnan:master

Conversation

@haobinnan

Copy link
Copy Markdown
Contributor

feat(format): recognize .hif extension
chore(deps): bump libheif to 1.23.6

feat(format): recognize .hif extension
chore(deps): bump libheif to 1.23.6

Signed-off-by: haobinnan <[email protected]>
@haobinnan

haobinnan commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

I have a HEIF (heix) file that causes an exception in PluginHEIF when parsing the image thumbnail. The issue is caused by the following code; commenting it out makes the problem go away. I'd appreciate it if you could take a look.

if(!(flags & FIF_LOAD_NOPIXELS) && heif_image_handle_get_number_of_thumbnails(image_handle.get()) > 0) {
heif_item_id id;
if(heif_image_handle_get_list_of_thumbnail_IDs(image_handle.get(), &id, 1) == 1) {
heif_image_handle raw_thumbnail = NULL;
Check(heif_image_handle_get_thumbnail(image_handle.get(), id, &raw_thumbnail));
std::unique_ptr<heif_image_handle, void (
)(const heif_image_handle )> thumbnail_handle(raw_thumbnail, heif_image_handle_release);
std::unique_ptr<FIBITMAP, void (
)(FIBITMAP *)> thumbnail(DecodeImage(thumbnail_handle.get(), 0, stream.length), FreeImage_Unload);
if(thumbnail) FreeImage_SetThumbnail(dib.get(), thumbnail.get());
}
}

Sample file: https://drive.google.com/file/d/1NJlVGIdl4ezqB8vneWJE7dxIH2dahNjP/view?usp=sharing

@haobinnan

Copy link
Copy Markdown
Contributor Author

@danoli3

@danoli3

danoli3 commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

@danoli3

danoli3 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Could you restrict the new PDB install rule to shared MSVC builds?

-if(MSVC)
+if(MSVC AND NOT FREEIMAGE_STATIC)
install(FILES $&lt;TARGET_PDB_FILE:${PROJECT_NAME}>

Static libraries produce a .lib archive without a linker-generated PDB. Evaluating TARGET_PDB_FILE for that target makes CMake fail during generation:

TARGET_PDB_FILE is allowed only for targets with linker created artifacts.

OPTIONAL only permits a missing file during installation; it doesn’t prevent this generation error.

Please keep the existing Debug configuration restriction and verify both FREEIMAGE_STATIC=ON and OFF on Windows. The static build should configure successfully, and the shared Debug build should still install its PDB.

@haobinnan

Copy link
Copy Markdown
Contributor Author

I agree with your suggestion. I had only considered the DLL build case.

@haobinnan

Copy link
Copy Markdown
Contributor Author

Could you also take care of the improvements in this commit and include them in the next release if possible?

@danoli3

danoli3 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Yes I can cherry pick and fix the issues and lets test for next release

@danoli3 danoli3 self-assigned this Oct 25, 2026
@haobinnan

Copy link
Copy Markdown
Contributor Author

Yes I can cherry pick and fix the issues and lets test for next release

Excellent!

@haobinnan

Copy link
Copy Markdown
Contributor Author

if(!(flags & FIF_LOAD_NOPIXELS) && heif_image_handle_get_number_of_thumbnails(image_handle.get()) > 0) { heif_item_id id; if(heif_image_handle_get_list_of_thumbnail_IDs(image_handle.get(), &id, 1) == 1) { heif_image_handle raw_thumbnail = NULL; Check(heif_image_handle_get_thumbnail(image_handle.get(), id, &raw_thumbnail)); std::unique_ptr<heif_image_handle, void ()(const heif_image_handle )> thumbnail_handle(raw_thumbnail, heif_image_handle_release); std::unique_ptr<FIBITMAP, void ()(FIBITMAP *)> thumbnail(DecodeImage(thumbnail_handle.get(), 0, stream.length), FreeImage_Unload); if(thumbnail) FreeImage_SetThumbnail(dib.get(), thumbnail.get()); } }

Sample file: https://drive.google.com/file/d/1NJlVGIdl4ezqB8vneWJE7dxIH2dahNjP/view?usp=sharing

Could you please keep an eye on this issue? Thank you!

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