Skip to content

Commit 53e2f7e

Browse files
committed
Minor tweak to ICC embedding code to improve logging output
1 parent dfafdb2 commit 53e2f7e

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
20/02/2025:
2-
- Re-ordered initializer lists in Watermark class constructor
2+
- Re-ordered initializer lists in Watermark class constructor.
3+
- Minor tweak to ICC embedding code to improve logging output.
34

45

56
19/02/2025:

src/CVT.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,11 @@ void CVT::send( Session* session ){
528528
}
529529
}
530530

531-
// Embed ICC profile if we have one and it is of an acceptable size
532-
if( (*session->image)->getMetadata("icc").size() > 0 ){
533-
if( session->view->maxICC() == -1 || (*session->image)->getMetadata("icc").size() < (unsigned long) session->view->maxICC() ){
531+
532+
// Embed ICC profile if we have one and if embedding has been enabled at start-up
533+
if( ( session->view->maxICC() != 0 ) && ( (*session->image)->getMetadata("icc").size() > 0 ) ){
534+
// Only embed if profile is of an acceptable size or if acceptable size is unlimited (-1)
535+
if( ( session->view->maxICC() == -1 ) || ( (*session->image)->getMetadata("icc").size() < (unsigned long)session->view->maxICC() ) ){
534536
if( session->loglevel >= 3 ){
535537
*(session->logfile) << "CVT :: Embedding ICC profile with size "
536538
<< (*session->image)->getMetadata("icc").size() << " bytes" << endl;
@@ -545,6 +547,7 @@ void CVT::send( Session* session ){
545547
}
546548
}
547549

550+
548551
// Always embed XMP metadata in CVT function
549552
if( (*session->image)->getMetadata("xmp").size() > 0 ){
550553
if( session->loglevel >= 3 ){

src/JTL.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ void JTL::send( Session* session, int resolution, int tile ){
150150
compressor->setMetadata( (*session->image)->metadata );
151151

152152

153-
// Embed ICC profile if we have one and it is of an acceptable size
154-
if( (*session->image)->getMetadata("icc").size() > 0 ){
155-
if( session->view->maxICC() == -1 || (*session->image)->getMetadata("icc").size() < (unsigned long) session->view->maxICC() ){
153+
// Embed ICC profile if we have one and if embedding has been enabled at start-up
154+
if( ( session->view->maxICC() != 0 ) && ( (*session->image)->getMetadata("icc").size() > 0 ) ){
155+
// Only embed if profile is of an acceptable size or if acceptable size is unlimited (-1)
156+
if( ( session->view->maxICC() == -1 ) || ( (*session->image)->getMetadata("icc").size() < (unsigned long)session->view->maxICC() ) ){
156157
if( session->loglevel >= 3 ){
157158
*(session->logfile) << "JTL :: Embedding ICC profile with size "
158159
<< (*session->image)->getMetadata("icc").size() << " bytes" << endl;

0 commit comments

Comments
 (0)