File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 3737/* Others */
3838#include <stdio.h>
3939#include <unistd.h>
40+ #include <arpa/inet.h>
4041
4142PG_MODULE_MAGIC ;
4243
@@ -260,11 +261,11 @@ Datum image_new(PG_FUNCTION_ARGS)
260261
261262 ccs = color -> cs ;
262263 if (ccs == CS_RGB .oid || ccs == CS_sRGB .oid ) {
263- map = "BGRP " ;
264+ map = "PRGB " ;
264265 } else if (ccs == CS_RGBA .oid ) {
265- map = "ABGR " ;
266+ map = "RGBA " ;
266267 } else if (ccs == CS_CMYK .oid ) {
267- map = "KYMC " ;
268+ map = "CMYK " ;
268269 } else {
269270 elog (ERROR , "Unsupported colorspace %d" , color -> cs );
270271 PG_RETURN_NULL ();
@@ -775,7 +776,7 @@ void pp_parse_color(const char * str, PPColor * color)
775776 strncpy (cs , str , i ); cs [i ]= 0 ;
776777 strcpy (cd , str + i + 1 );
777778
778- color -> cd = strtoll (cd , NULL , 16 );
779+ color -> cd = htonl ( strtoll (cd , NULL , 16 ) );
779780 if (!cs [0 ]) {
780781 color -> cs = (strlen (cd )> 6 ? CS_RGBA .oid : CS_RGB .oid );
781782 } else {
You can’t perform that action at this time.
0 commit comments