File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ dt_imageio_retval_t dt_imageio_open_pfm(dt_image_t *img,
133133 for_three_channels (c )
134134 {
135135 value .as_float = readbuf [3 * (target_row * img -> width + column ) + c ];
136- if (swap_byte_order ) value .as_int = GUINT32_SWAP_LE_BE (value .as_int );
136+ if (swap_byte_order )
137+ value .as_int = GUINT32_SWAP_LE_BE (value .as_int );
137138 pix [c ] = value .as_float ;
138139 }
139140 copy_pixel_nontemporal (& buf [4 * (img -> width * row + column )], pix );
@@ -148,10 +149,11 @@ dt_imageio_retval_t dt_imageio_open_pfm(dt_image_t *img,
148149 const size_t target_row = made_by_photoshop ? row : img -> height - 1 - row ;
149150 for (size_t column = 0 ; column < img -> width ; column ++ )
150151 {
152+ const size_t idx = img -> width * row + column ;
151153 value .as_float = readbuf [target_row * img -> width + column ];
152- if (swap_byte_order ) value . as_int = GUINT32_SWAP_LE_BE ( value . as_int );
153- buf [ 4 * ( img -> width * row + column ) + 2 ] = buf [ 4 * ( img -> width * row + column ) + 1 ]
154- = buf [4 * ( img -> width * row + column ) + 0 ] = value .as_float ;
154+ if (swap_byte_order )
155+ value . as_int = GUINT32_SWAP_LE_BE ( value . as_int );
156+ buf [ 4 * idx + 2 ] = buf [4 * idx + 1 ] = buf [ 4 * idx + 0 ] = value .as_float ;
155157 }
156158 }
157159 }
You can’t perform that action at this time.
0 commit comments