MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / addImageFromFile

Method addImageFromFile

source/MRIOExtras/MRPdf.cpp:481–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479
480
481void Pdf::addImageFromFile( const std::filesystem::path& imagePath, const ImageParams& params )
482{
483 if ( !checkDocument_( "add image from file" ) )
484 return;
485
486 if ( imagePath.empty() )
487 {
488 spdlog::warn( "Pdf: can't add image from file: empty path." );
489 return;
490 }
491
492 HPDF_Image pdfImage = MR_HPDF_CHECK_ERROR( HPDF_LoadPngImageFromFile( state_->document, utf8string( imagePath ).c_str() ) );
493 addImage_( { pdfImage }, params );
494}
495
496void Pdf::addImage( const Image& image, const ImageParams& params )
497{

Callers 1

TESTFunction · 0.80

Calls 2

utf8stringFunction · 0.85
emptyMethod · 0.45

Tested by 1

TESTFunction · 0.64