aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c b/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c
index 27f5f24..4449db0 100644
--- a/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c
+++ b/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c
@@ -509,12 +509,10 @@ get_single_channel(Image_Entry *ie __UNUSED__,
509 Eina_Bool compressed) 509 Eina_Bool compressed)
510{ 510{
511 unsigned int i, bpc; 511 unsigned int i, bpc;
512 unsigned short *tmp;
513 char headbyte; 512 char headbyte;
514 int c; 513 int c;
515 int pixels_count; 514 int pixels_count;
516 515
517 tmp = (unsigned short*)buffer;
518 bpc = (head->depth / 8); 516 bpc = (head->depth / 8);
519 pixels_count = head->width * head->height; 517 pixels_count = head->width * head->height;
520 518
@@ -569,7 +567,6 @@ read_psd_grey(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_
569{ 567{
570 unsigned int color_mode, resource_size, misc_info; 568 unsigned int color_mode, resource_size, misc_info;
571 unsigned short compressed; 569 unsigned short compressed;
572 unsigned int type;
573 void *surface = NULL; 570 void *surface = NULL;
574 571
575 *error = EVAS_LOAD_ERROR_CORRUPT_FILE; 572 *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
@@ -602,10 +599,7 @@ read_psd_grey(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_
602 switch (head->depth) 599 switch (head->depth)
603 { 600 {
604 case 8: 601 case 8:
605 type = 1;
606 break;
607 case 16: 602 case 16:
608 type = 2;
609 break; 603 break;
610 default: 604 default:
611 *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; 605 *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
@@ -697,7 +691,6 @@ read_psd_rgb(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t
697{ 691{
698 unsigned int color_mode, resource_size, misc_info; 692 unsigned int color_mode, resource_size, misc_info;
699 unsigned short compressed; 693 unsigned short compressed;
700 unsigned int type;
701 void *surface; 694 void *surface;
702 695
703#define CHECK_RET(Call) \ 696#define CHECK_RET(Call) \
@@ -721,10 +714,7 @@ read_psd_rgb(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t
721 switch (head->depth) 714 switch (head->depth)
722 { 715 {
723 case 8: 716 case 8:
724 type = 1;
725 break;
726 case 16: 717 case 16:
727 type = 2;
728 break; 718 break;
729 default: 719 default:
730 *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; 720 *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
@@ -758,7 +748,7 @@ read_psd_rgb(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t
758Eina_Bool 748Eina_Bool
759read_psd_cmyk(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) 749read_psd_cmyk(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error)
760{ 750{
761 unsigned int color_mode, resource_size, misc_info, size, i, j, data_size; 751 unsigned int color_mode, resource_size, misc_info, size, j, data_size;
762 unsigned short compressed; 752 unsigned short compressed;
763 unsigned int format, type; 753 unsigned int format, type;
764 unsigned char *kchannel = NULL; 754 unsigned char *kchannel = NULL;
@@ -841,7 +831,7 @@ read_psd_cmyk(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_
841 unsigned char *tmp = surface; 831 unsigned char *tmp = surface;
842 const unsigned char *limit = tmp + data_size; 832 const unsigned char *limit = tmp + data_size;
843 833
844 for (i = 0, j = 0; tmp < limit; tmp++, j++) 834 for (j = 0; tmp < limit; tmp++, j++)
845 { 835 {
846 int k; 836 int k;
847 837
@@ -857,7 +847,7 @@ read_psd_cmyk(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_
857 const unsigned char *limit = tmp + data_size; 847 const unsigned char *limit = tmp + data_size;
858 848
859 // The KChannel array really holds the alpha channel on this one. 849 // The KChannel array really holds the alpha channel on this one.
860 for (i = 0, j = 0; tmp < limit; tmp += 4, j++) 850 for (j = 0; tmp < limit; tmp += 4, j++)
861 { 851 {
862 tmp[0] = (tmp[0] * tmp[3]) >> 8; 852 tmp[0] = (tmp[0] * tmp[3]) >> 8;
863 tmp[1] = (tmp[1] * tmp[3]) >> 8; 853 tmp[1] = (tmp[1] * tmp[3]) >> 8;