00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <magick/MagickCore.h>
00017
00018
00019 #include "imageMS.h"
00020 #include "imageMSutil.h"
00021 #include "rsApiHandler.h"
00022 #include "apiHeaderAll.h"
00023 #include "dataObjOpen.h"
00024 #include "dataObjLseek.h"
00025 #include "dataObjClose.h"
00026 #include "fileLseek.h"
00027 #include "dataObjInpOut.h"
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 int
00056 _ImageGetFileParameter( rsComm_t* rsComm, char* messageBase,
00057 msParam_t* param, ImageFileParameter_t *result )
00058 {
00059 dataObjInp_t *resultObject;
00060 int status;
00061
00062
00063
00064 if ( param == NULL )
00065 {
00066 status = SYS_INTERNAL_NULL_INPUT_ERR;
00067 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00068 "%s: NULL file argument",
00069 messageBase );
00070 return status;
00071 }
00072
00073
00074
00075 if ( strcmp( param->type, INT_MS_T ) == 0 )
00076 {
00077 result->fd = *(int *)param->inOutStruct;
00078 result->type = IMAGEFILEPARAMETER_FD;
00079 if ( result->fd <= 0 )
00080 {
00081 status = USER_PARAM_TYPE_ERR;
00082 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00083 "%s: file argument descriptor %d is negative",
00084 messageBase, result->fd );
00085 return status;
00086 }
00087 return 0;
00088 }
00089
00090
00091
00092
00093
00094 if ( strcmp( param->type, STR_MS_T ) == 0 )
00095 {
00096 char* endParse = NULL;
00097
00098 result->path = (char*)param->inOutStruct;
00099 result->type = IMAGEFILEPARAMETER_PATH;
00100 if ( result->path == NULL || strcmp( result->path, "null" ) == 0 )
00101 {
00102 status = SYS_NULL_INPUT;
00103 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00104 "%s: file argument is a 'null' path",
00105 messageBase );
00106 return status;
00107 }
00108
00109
00110
00111 result->fd = (int)strtol( result->path, &endParse, 10 );
00112 if ( result->path != endParse )
00113 {
00114 result->path = NULL;
00115 result->type = IMAGEFILEPARAMETER_FD;
00116 if ( result->fd <= 0 )
00117 {
00118 status = USER_PARAM_TYPE_ERR;
00119 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00120 "%s: file argument descriptor %d is negative",
00121 messageBase, result->fd );
00122 return status;
00123 }
00124 }
00125 return 0;
00126 }
00127
00128
00129
00130 status = parseMspForDataObjInp( param, result->dataObject, &resultObject, 0 );
00131 if ( status < 0 )
00132 {
00133 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00134 "%s: file argument problem, status = %d",
00135 messageBase, status );
00136 return status;
00137 }
00138
00139 result->type = IMAGEFILEPARAMETER_OBJECT;
00140 result->dataObject = resultObject;
00141 return 0;
00142 }
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 int
00156 _ImageGetPropertyListParameter( rsComm_t* rsComm, char* messageBase,
00157 msParam_t* param, keyValPair_t** result )
00158 {
00159
00160
00161
00162 if ( param == NULL )
00163 return 0;
00164
00165
00166 if ( strcmp( param->type, STR_MS_T ) != 0 )
00167 {
00168 int status = USER_PARAM_TYPE_ERR;
00169 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00170 "%s: property list argument is not a string",
00171 messageBase );
00172 return status;
00173 }
00174
00175
00176 keyValFromString( (char*)param->inOutStruct, result );
00177 return 0;
00178 }
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192 int
00193 _ImageGetDouble( rsComm_t* rsComm, char* messageBase,
00194 msParam_t* param, double* result )
00195 {
00196
00197 if ( param == NULL )
00198 {
00199 int status = USER_PARAM_TYPE_ERR;
00200 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00201 "%s: double argument is null",
00202 messageBase );
00203 return status;
00204 }
00205
00206
00207
00208 if ( strcmp( param->type, INT_MS_T ) != 0 )
00209 {
00210 *result = (double)(*(int *)param->inOutStruct);
00211 return 0;
00212 }
00213
00214
00215
00216 if ( strcmp( param->type, DOUBLE_MS_T ) != 0 )
00217 {
00218 *result = *(double *)param->inOutStruct;
00219 return 0;
00220 }
00221
00222
00223 if ( strcmp( param->type, STR_MS_T ) != 0 )
00224 {
00225 int status = USER_PARAM_TYPE_ERR;
00226 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00227 "%s: format argument is not a string",
00228 messageBase );
00229 return status;
00230 }
00231
00232
00233 *result = atof( (char*)param->inOutStruct );
00234 return 0;
00235 }
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 int
00258 _ImageReadFile( rsComm_t* rsComm, char* messageBase,
00259 ImageFileParameter_t* file )
00260 {
00261
00262 fileLseekOut_t* seekResult = NULL;
00263
00264
00265 dataObjInp_t openParam;
00266
00267 int fd = -1;
00268 int fileWasOpened = FALSE;
00269 int fileLength = 0;
00270 bytesBuf_t data;
00271 char* format = NULL;
00272 int status;
00273
00274 openedDataObjInp_t seekParam_of_another_color;
00275 openedDataObjInp_t closeParam_of_another_color;
00276 openedDataObjInp_t readParam_of_another_color;
00277
00278 ImageInfo* info = NULL;
00279 ExceptionInfo* errors = NULL;
00280
00281 memset( &openParam, 0, sizeof(dataObjInp_t) );
00282
00283
00284
00285 memset( &data, 0, sizeof(bytesBuf_t) );
00286
00287 memset( &seekParam_of_another_color, 0, sizeof(openedDataObjInp_t));
00288 memset( &closeParam_of_another_color, 0, sizeof(openedDataObjInp_t));
00289 memset( &readParam_of_another_color, 0, sizeof(openedDataObjInp_t));
00290
00291
00292
00293
00294 if ( file->type == IMAGEFILEPARAMETER_PATH )
00295 {
00296 rstrcpy( openParam.objPath, file->path, MAX_NAME_LEN );
00297 openParam.openFlags = O_RDONLY;
00298
00299 status = rsDataObjOpen( rsComm, &openParam );
00300 if ( status < 0 )
00301 {
00302 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00303 "%s: could not open file, status = %d",
00304 messageBase, status );
00305 return status;
00306 }
00307 fd = status;
00308 fileWasOpened = TRUE;
00309 }
00310
00311
00312
00313 else if ( file->type == IMAGEFILEPARAMETER_OBJECT )
00314 {
00315
00316 status = rsDataObjOpen( rsComm, file->dataObject );
00317 if ( status < 0 )
00318 {
00319 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00320 "%s: could not open file, status = %d",
00321 messageBase, status );
00322 return status;
00323 }
00324 fd = status;
00325 fileWasOpened = TRUE;
00326 }
00327
00328
00329
00330 else
00331 {
00332 fd = file->fd;
00333 fileWasOpened = FALSE;
00334 }
00335
00336
00337
00338
00339
00340
00341
00342
00343 seekParam_of_another_color.l1descInx = fd;
00344 seekParam_of_another_color.offset = 0;
00345 seekParam_of_another_color.whence = SEEK_END;
00346
00347 status = rsDataObjLseek( rsComm, &seekParam_of_another_color, &seekResult );
00348 if ( status < 0 || NULL == seekResult )
00349 {
00350 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00351 "%s: could not seek to end of file, status = %d",
00352 messageBase, status );
00353
00354
00355 if ( fileWasOpened )
00356 {
00357
00358 closeParam_of_another_color.l1descInx = fd;
00359 rsDataObjClose( rsComm, &closeParam_of_another_color );
00360 }
00361 return status;
00362 }
00363 fileLength = seekResult->offset;
00364
00365
00366
00367
00368
00369 seekParam_of_another_color.offset = 0;
00370 seekParam_of_another_color.whence = SEEK_SET;
00371
00372 status = rsDataObjLseek( rsComm, &seekParam_of_another_color, &seekResult );
00373 if ( status < 0 )
00374 {
00375 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00376 "%s: could not seek to start of file, status = %d",
00377 messageBase, status );
00378
00379
00380 if ( fileWasOpened )
00381 {
00382
00383 closeParam_of_another_color.l1descInx = fd;
00384 rsDataObjClose( rsComm, &closeParam_of_another_color );
00385 }
00386 return status;
00387 }
00388
00389
00390
00391
00392
00393 readParam_of_another_color.l1descInx = fd;
00394 readParam_of_another_color.len = fileLength;
00395
00396 data.len = fileLength;
00397 data.buf = (void*)malloc( fileLength );
00398
00399 status = rsDataObjRead( rsComm, &readParam_of_another_color, &data );
00400 if ( status < 0 )
00401 {
00402 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00403 "%s: could not read file, status = %d",
00404 messageBase, status );
00405 free( (char*)data.buf );
00406
00407
00408 if ( fileWasOpened )
00409 {
00410
00411 closeParam_of_another_color.l1descInx = fd;
00412 rsDataObjClose( rsComm, &closeParam_of_another_color );
00413 }
00414 return status;
00415 }
00416
00417
00418
00419 if ( fileWasOpened )
00420 {
00421
00422 closeParam_of_another_color.l1descInx = fd;
00423 status = rsDataObjClose( rsComm, &closeParam_of_another_color );
00424 if ( status < 0 )
00425 {
00426 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00427 "%s: could not close file, status = %d",
00428 messageBase, status );
00429 free( (char*)data.buf );
00430 return status;
00431 }
00432 fd = -1;
00433 }
00434
00435
00436
00437 errors = AcquireExceptionInfo( );
00438 info = AcquireImageInfo( );
00439
00440
00441
00442
00443
00444 format = _ImageGuessFormat( file );
00445 if ( format != NULL )
00446 {
00447 strncpy( info->magick, format, MaxTextExtent );
00448 free( (char*)format );
00449 }
00450
00451
00452
00453 file->image = BlobToImage( info, data.buf, data.len, errors );
00454 CatchException( errors );
00455 free( (char*)data.buf );
00456 if ( file->image == NULL )
00457 {
00458 status = ACTION_FAILED_ERR;
00459 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00460 "%s: could not parse image file, status = %d",
00461 messageBase, status );
00462 DestroyExceptionInfo( errors );
00463 DestroyImageInfo( info );
00464 return status;
00465 }
00466
00467 return 0;
00468 }
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483 int
00484 _ImageWriteFile( rsComm_t* rsComm, char* messageBase,
00485 ImageFileParameter_t* file )
00486 {
00487
00488
00489 dataObjInp_t openParam;
00490
00491 openedDataObjInp_t closeParam_of_another_color;
00492 openedDataObjInp_t writeParam_of_another_color;
00493
00494
00495 ImageInfo* info = NULL;
00496 ExceptionInfo* errors = NULL;
00497
00498 int status;
00499 int fd = -1;
00500 int fileWasOpened = FALSE;
00501 unsigned long fileLength = 0;
00502 char* format = NULL;
00503 bytesBuf_t data;
00504
00505 memset( &openParam, 0, sizeof(dataObjInp_t) );
00506
00507
00508 memset( &data, 0, sizeof(bytesBuf_t) );
00509 memset( &closeParam_of_another_color, 0, sizeof(openedDataObjInp_t) );
00510 memset( &writeParam_of_another_color, 0, sizeof(openedDataObjInp_t) );
00511
00512
00513
00514
00515 errors = AcquireExceptionInfo( );
00516 info = AcquireImageInfo( );
00517
00518
00519
00520
00521
00522
00523
00524 format = _ImageGuessFormat( file );
00525 if ( format != NULL )
00526 {
00527 strncpy( info->magick, format, MaxTextExtent );
00528 free( (char*)format );
00529 }
00530
00531
00532
00533
00534
00535
00536 data.buf = ImageToBlob( info, file->image, &fileLength, errors );
00537 data.len = (int)fileLength;
00538 CatchException( errors );
00539 if ( data.buf == NULL )
00540 {
00541 status = ACTION_FAILED_ERR;
00542 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00543 "%s: could not convert to format %s, status = %d",
00544 messageBase,
00545 (info->magick == NULL) ? "unknown" : info->magick, status );
00546 DestroyExceptionInfo( errors );
00547 DestroyImageInfo( info );
00548 return status;
00549 }
00550
00551
00552
00553
00554 DestroyExceptionInfo( errors );
00555 DestroyImageInfo( info );
00556
00557
00558
00559 if ( file->type == IMAGEFILEPARAMETER_PATH )
00560 {
00561 rstrcpy( openParam.objPath, file->path, MAX_NAME_LEN );
00562 openParam.openFlags = O_WRONLY|O_CREAT;
00563 addKeyVal( &openParam.condInput, DATA_TYPE_KW, "generic" );
00564
00565 status = rsDataObjOpen( rsComm, &openParam );
00566 if ( status < 0 )
00567 {
00568 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00569 "%s: could not create file, status = %d",
00570 messageBase, status );
00571 return status;
00572 }
00573 fd = status;
00574 fileWasOpened = TRUE;
00575 }
00576
00577
00578 else if ( file->type == IMAGEFILEPARAMETER_OBJECT )
00579 {
00580 status = rsDataObjOpen( rsComm, file->dataObject );
00581 if ( status < 0 )
00582 {
00583 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00584 "%s: could not create file, status = %d",
00585 messageBase, status );
00586 return status;
00587 }
00588 fd = status;
00589 fileWasOpened = TRUE;
00590 }
00591
00592
00593
00594
00595 else
00596 {
00597 fd = file->fd;
00598 fileWasOpened = FALSE;
00599 }
00600
00601
00602
00603 writeParam_of_another_color.l1descInx = fd;
00604 writeParam_of_another_color.len = data.len;
00605 status = rsDataObjWrite( rsComm, &writeParam_of_another_color, &data );
00606 if ( status < 0 )
00607 {
00608 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00609 "%s: could not write file, status = %d",
00610 messageBase, status );
00611 free( (char*)data.buf );
00612 return status;
00613 }
00614 free( (char*)data.buf );
00615
00616
00617
00618 if ( fileWasOpened )
00619 {
00620
00621 closeParam_of_another_color.l1descInx = fd;
00622 status = rsDataObjClose( rsComm, &closeParam_of_another_color );
00623 if ( status < 0 )
00624 {
00625 rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, status,
00626 "%s: could not close file, status = %d",
00627 messageBase, status );
00628 return status;
00629 }
00630 fd = -1;
00631 fileWasOpened = FALSE;
00632 }
00633
00634 return 0;
00635 }
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649 char*
00650 _ImageGuessFormat( ImageFileParameter_t* file )
00651 {
00652
00653 if ( file->properties != NULL )
00654 {
00655
00656 char* value = getValByKey( file->properties, PROPERTY_IMAGE_FORMAT );
00657 if ( value != NULL )
00658 return value;
00659 }
00660
00661
00662 if ( file->type == IMAGEFILEPARAMETER_PATH )
00663 {
00664 char* dot = rindex( file->path, '.' );
00665 if ( dot != NULL && *(dot+1) != '\0' )
00666 return strdup( dot+1 );
00667 }
00668
00669
00670 return NULL;
00671 }
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692 int
00693 _ImageGetProperties( ImageFileParameter_t* file, keyValPair_t* list )
00694 {
00695 char* value = NULL;
00696 char* name = NULL;
00697 char buffer[1000];
00698 const int lenPrefix = strlen( PROPERTY_IMAGE_PREFIX );
00699
00700
00701
00702
00703
00704 GetImageProperty( file->image, "exif:*" );
00705 GetImageProperty( file->image, "8bim:*" );
00706 GetImageProperty( file->image, "fx:*" );
00707 GetImageProperty( file->image, "iptc:*" );
00708 GetImageProperty( file->image, "pixel:*" );
00709 GetImageProperty( file->image, "xmp:*" );
00710 GetImageProperty( file->image, "*" );
00711
00712 ResetImagePropertyIterator( file->image );
00713 for ( name = GetNextImageProperty( file->image ); name != NULL;
00714 name = GetNextImageProperty( file->image ) )
00715 {
00716 char* newname = NULL;
00717 int len = 0;
00718 int i;
00719
00720
00721 value = (char*)GetImageProperty( file->image, name );
00722 if ( value == NULL || *value == '\0' )
00723 continue;
00724
00725
00726 len = strlen( name ) + lenPrefix;
00727 newname = (char*)malloc( len + 1 );
00728 strcpy( newname, PROPERTY_IMAGE_PREFIX );
00729 strcat( newname, name );
00730
00731
00732
00733
00734
00735
00736 for ( i = 0; i < len; i++ )
00737 {
00738 if ( newname[i] == ':' )
00739 newname[i] = '.';
00740 }
00741
00742
00743 addKeyVal( list, newname, value );
00744 }
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755 if ( file->image->magick != NULL )
00756 {
00757
00758
00759 addKeyVal( list, PROPERTY_IMAGE_FORMAT, file->image->magick );
00760 }
00761
00762 switch ( file->image->compression )
00763 {
00764 default:
00765 case UndefinedCompression: value = NULL; break;
00766 case NoCompression: value = "none"; break;
00767 case BZipCompression: value = "bzip"; break;
00768 case FaxCompression: value = "fax"; break;
00769 case Group4Compression: value = "group4"; break;
00770 case JPEGCompression: value = "jpeg"; break;
00771 case JPEG2000Compression: value = "jpeg2000"; break;
00772 case LosslessJPEGCompression: value = "jpeglossless"; break;
00773 case LZWCompression: value = "lzw"; break;
00774 case RLECompression: value = "rle"; break;
00775 case ZipCompression: value = "zip"; break;
00776 }
00777 if ( value != NULL )
00778 {
00779
00780 addKeyVal( list, PROPERTY_IMAGE_COMPRESSION, value );
00781 }
00782
00783 if ( file->image->quality > 0 )
00784 {
00785 sprintf( buffer, "%D", file->image->quality );
00786 addKeyVal( list, PROPERTY_IMAGE_COMPRESSIONQUALITY, buffer );
00787 }
00788
00789 switch ( file->image->interlace )
00790 {
00791 default:
00792 case UndefinedInterlace: value = NULL; break;
00793 case NoInterlace: value = "none"; break;
00794 case LineInterlace: value = "line"; break;
00795 case PlaneInterlace: value = "plane"; break;
00796 case PartitionInterlace: value = "partition"; break;
00797 case GIFInterlace: value = "gif"; break;
00798 case JPEGInterlace: value = "jpeg"; break;
00799 case PNGInterlace: value = "png"; break;
00800 }
00801 if ( value != NULL )
00802 {
00803
00804 addKeyVal( list, PROPERTY_IMAGE_INTERLACE, value );
00805 }
00806
00807 switch ( file->image->colorspace )
00808 {
00809 default:
00810 case UndefinedColorspace: value = NULL; break;
00811 case RGBColorspace: value = "rgb"; break;
00812 case GRAYColorspace: value = "gray"; break;
00813 case TransparentColorspace: value = "transparent"; break;
00814 case OHTAColorspace: value = "ohta"; break;
00815 case LABColorspace: value = "lab"; break;
00816 case XYZColorspace: value = "xyz"; break;
00817 case YCbCrColorspace: value = "ycbcr"; break;
00818 case YCCColorspace: value = "ycc"; break;
00819 case YIQColorspace: value = "yiq"; break;
00820 case YPbPrColorspace: value = "ypbpr"; break;
00821 case YUVColorspace: value = "yuv"; break;
00822 case CMYKColorspace: value = "cmyk"; break;
00823 case sRGBColorspace: value = "srgb"; break;
00824 case HSBColorspace: value = "hsb"; break;
00825 case HSLColorspace: value = "hsl"; break;
00826 case HWBColorspace: value = "hwb"; break;
00827 case Rec601LumaColorspace: value = "rec601luma"; break;
00828 case Rec601YCbCrColorspace: value = "rec601ycbcr"; break;
00829 case Rec709LumaColorspace: value = "rec709luma"; break;
00830 case Rec709YCbCrColorspace: value = "rec709ycbcr"; break;
00831 }
00832 if ( value != NULL )
00833 {
00834
00835 addKeyVal( list, PROPERTY_IMAGE_COLORSPACE, value );
00836 }
00837
00838 if ( file->image->depth > 0 )
00839 {
00840
00841 sprintf( buffer, "%D", file->image->depth );
00842 addKeyVal( list, PROPERTY_IMAGE_DEPTH, buffer );
00843 }
00844
00845 if ( file->image->colors > 0 )
00846 {
00847
00848 sprintf( buffer, "%D", file->image->colors );
00849 addKeyVal( list, PROPERTY_IMAGE_COLORS, buffer );
00850 }
00851
00852 if ( file->image->gamma > 0.0 )
00853 {
00854
00855 sprintf( buffer, "%F", file->image->gamma );
00856 addKeyVal( list, PROPERTY_IMAGE_GAMMA, buffer );
00857 }
00858
00859 if ( file->image->x_resolution > 0.0 )
00860 {
00861
00862 sprintf( buffer, "%F", file->image->x_resolution );
00863 addKeyVal( list, PROPERTY_IMAGE_XRESOLUTION, buffer );
00864 }
00865
00866 if ( file->image->y_resolution > 0.0 )
00867 {
00868
00869 sprintf( buffer, "%F", file->image->y_resolution );
00870 addKeyVal( list, PROPERTY_IMAGE_YRESOLUTION, buffer );
00871 }
00872
00873 switch ( file->image->units )
00874 {
00875 default:
00876 case UndefinedResolution: value = NULL; break;
00877 case PixelsPerInchResolution: value = "pixelsperinch"; break;
00878 case PixelsPerCentimeterResolution: value = "pixelspercentimeter"; break;
00879 }
00880 if ( value != NULL )
00881 {
00882
00883 addKeyVal( list, PROPERTY_IMAGE_RESOLUTIONUNIT, value );
00884 }
00885
00886 switch ( file->image->orientation )
00887 {
00888 default:
00889 case UndefinedOrientation: value = NULL; break;
00890 case TopLeftOrientation: value = "topleft"; break;
00891 case TopRightOrientation: value = "topright"; break;
00892 case BottomRightOrientation: value = "bottomright"; break;
00893 case BottomLeftOrientation: value = "bottomleft"; break;
00894 case LeftTopOrientation: value = "lefttop"; break;
00895 case RightTopOrientation: value = "righttop"; break;
00896 case RightBottomOrientation: value = "rightbottom"; break;
00897 case LeftBottomOrientation: value = "leftbottom"; break;
00898 }
00899 if ( value != NULL )
00900 {
00901
00902 addKeyVal( list, PROPERTY_IMAGE_ORIENTATION, value );
00903 }
00904
00905 if ( file->image->rows > 0 )
00906 {
00907
00908 sprintf( buffer, "%D", file->image->rows );
00909 addKeyVal( list, PROPERTY_IMAGE_ROWS, buffer );
00910 }
00911
00912 if ( file->image->columns > 0 )
00913 {
00914
00915 sprintf( buffer, "%D", file->image->columns );
00916 addKeyVal( list, PROPERTY_IMAGE_COLUMNS, buffer );
00917 }
00918
00919 return 0;
00920 }