equal
deleted
inserted
replaced
444 properties->GetProperty(KPropertyQuality, quality); |
444 properties->GetProperty(KPropertyQuality, quality); |
445 |
445 |
446 TPtrC encoding; |
446 TPtrC encoding; |
447 if (properties->Compare(KPropertyEncoding, KFormatPng) || |
447 if (properties->Compare(KPropertyEncoding, KFormatPng) || |
448 properties->Compare(KPropertyEncoding, KContentTypePng)) |
448 properties->Compare(KPropertyEncoding, KContentTypePng)) |
449 { //PNG |
449 { |
|
450 //PNG |
450 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypePng); |
451 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypePng); |
451 TPngEncodeData* imageData = new(ELeave)TPngEncodeData(); |
452 TPngEncodeData* imageData = new(ELeave)TPngEncodeData(); |
452 imageData->iBitsPerPixel = KDefaultBpp; |
453 imageData->iBitsPerPixel = KDefaultBpp; |
453 imageData->iColor = ETrue; |
454 imageData->iColor = ETrue; |
454 imageData->iPaletted = EFalse; |
455 imageData->iPaletted = EFalse; |
494 } |
495 } |
495 } |
496 } |
496 else if (properties->Compare(KPropertyEncoding, KFormatJpg) || |
497 else if (properties->Compare(KPropertyEncoding, KFormatJpg) || |
497 properties->Compare(KPropertyEncoding, KContentTypeJpg) || |
498 properties->Compare(KPropertyEncoding, KContentTypeJpg) || |
498 properties->Compare(KPropertyEncoding, KContentTypeJpg2)) |
499 properties->Compare(KPropertyEncoding, KContentTypeJpg2)) |
499 { // JPG |
500 { |
|
501 // JPG |
500 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypeJpg); |
502 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypeJpg); |
501 if (properties->Compare(KPropertyType, KPropertyJfif())) |
503 if (properties->Compare(KPropertyType, KPropertyJfif())) |
502 { |
504 { |
503 settings->iType = CreateHBufC8FromUnicodeL(KPropertyJfif()); |
505 settings->iType = CreateHBufC8FromUnicodeL(KPropertyJfif()); |
504 } |
506 } |
533 User::Leave(KErrArgument); |
535 User::Leave(KErrArgument); |
534 } |
536 } |
535 } |
537 } |
536 else if (properties->Compare(KPropertyEncoding, KFormatGif) || |
538 else if (properties->Compare(KPropertyEncoding, KFormatGif) || |
537 properties->Compare(KPropertyEncoding, KContentTypeGif)) |
539 properties->Compare(KPropertyEncoding, KContentTypeGif)) |
538 {//GIF |
540 { |
|
541 //GIF |
539 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypeGif); |
542 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypeGif); |
540 TPtrC tmp; |
543 TPtrC tmp; |
541 // gif encoder is not configurable |
544 // gif encoder is not configurable |
542 if (properties->GetProperty(KPropertyColor, tmp) || |
545 if (properties->GetProperty(KPropertyColor, tmp) || |
543 properties->GetProperty(KPropertyType, tmp) || |
546 properties->GetProperty(KPropertyType, tmp) || |
546 User::Leave(KErrArgument); |
549 User::Leave(KErrArgument); |
547 } |
550 } |
548 } |
551 } |
549 else if (properties->Compare(KPropertyEncoding, KFormatBmp) || |
552 else if (properties->Compare(KPropertyEncoding, KFormatBmp) || |
550 properties->Compare(KPropertyEncoding, KContentTypeBmp)) |
553 properties->Compare(KPropertyEncoding, KContentTypeBmp)) |
551 {//BMP |
554 { |
|
555 //BMP |
552 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypeBmp); |
556 settings->iMimeType = CreateHBufC8FromUnicodeL(KContentTypeBmp); |
553 TBmpImageData* imageData = new(ELeave)TBmpImageData(); |
557 TBmpImageData* imageData = new(ELeave)TBmpImageData(); |
554 CleanupStack::PushL(imageData); |
558 CleanupStack::PushL(imageData); |
555 imageData->iBitsPerPixel = KDefaultBpp; |
559 imageData->iBitsPerPixel = KDefaultBpp; |
556 TPtrC color; |
560 TPtrC color; |
580 { |
584 { |
581 User::Leave(KErrArgument); |
585 User::Leave(KErrArgument); |
582 } |
586 } |
583 } |
587 } |
584 else if (properties->GetProperty(KPropertyEncoding, encoding)) |
588 else if (properties->GetProperty(KPropertyEncoding, encoding)) |
585 { // OTHER POSSIBLE TYPE |
589 { |
|
590 // OTHER POSSIBLE TYPE |
586 // trying to create encoder with only content/mime-type |
591 // trying to create encoder with only content/mime-type |
587 settings->iMimeType = CreateHBufC8FromUnicodeL(encoding); |
592 settings->iMimeType = CreateHBufC8FromUnicodeL(encoding); |
588 |
593 |
589 // No extra parameters, only content-type |
594 // No extra parameters, only content-type |
590 TPtrC tmp; |
595 TPtrC tmp; |