Display original picture size in Load/Save dialog when displaying a thumbnail
This commit is contained in:
		
							parent
							
								
									3876f8e1c5
								
							
						
					
					
						commit
						b0203ff93c
					
				@ -1765,6 +1765,8 @@ printf("%d x %d = %d   %d\n", tiny_width, tiny_height, tiny_width*tiny_height, s
 | 
			
		||||
          if ((context->Type == CONTEXT_PREVIEW || context->Type == CONTEXT_PREVIEW_PALETTE)
 | 
			
		||||
            && tiny_width > 0 && tiny_height > 0)
 | 
			
		||||
          {
 | 
			
		||||
            context->Original_width = header.Width;
 | 
			
		||||
            context->Original_height = header.Height;
 | 
			
		||||
            Pre_load(context, tiny_width, tiny_height,file_size,iff_format,ratio,bpp);
 | 
			
		||||
            context->Background_transparent = header.Mask == 2;
 | 
			
		||||
            context->Transparent_color = context->Background_transparent ? header.Transp_col : 0;
 | 
			
		||||
 | 
			
		||||
@ -428,16 +428,22 @@ void Pre_load(T_IO_Context *context, short width, short height, long file_size,
 | 
			
		||||
        File_error=1;
 | 
			
		||||
 | 
			
		||||
      // Affichage des données "Image size:"
 | 
			
		||||
      if ((width<10000) && (height<10000))
 | 
			
		||||
      memcpy(str, "VERY BIG!", 10); // default string
 | 
			
		||||
      if (context->Original_width != 0)
 | 
			
		||||
      {
 | 
			
		||||
        if (context->Original_width < 10000 && context->Original_height < 10000)
 | 
			
		||||
        {
 | 
			
		||||
          Num2str(context->Original_width,str,4);
 | 
			
		||||
          Num2str(context->Original_height,str+5,4);
 | 
			
		||||
          str[4]='x';
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      else if ((width<10000) && (height<10000))
 | 
			
		||||
      {
 | 
			
		||||
        Num2str(width,str,4);
 | 
			
		||||
        Num2str(height,str+5,4);
 | 
			
		||||
        str[4]='x';
 | 
			
		||||
      }
 | 
			
		||||
      else
 | 
			
		||||
      {
 | 
			
		||||
        memcpy(str, "VERY BIG!", 10);
 | 
			
		||||
      }
 | 
			
		||||
      Print_in_window(101,59,str,MC_Black,MC_Light);
 | 
			
		||||
      snprintf(str, sizeof(str), "%2dbpp", bpp);
 | 
			
		||||
      Print_in_window(181,59,str,MC_Black,MC_Light);
 | 
			
		||||
 | 
			
		||||
@ -65,6 +65,8 @@ typedef struct
 | 
			
		||||
  T_Palette Palette;
 | 
			
		||||
  short Width;
 | 
			
		||||
  short Height;
 | 
			
		||||
  short Original_width;   /// Size of the whole image in case of PREVIEW of a thumbnail
 | 
			
		||||
  short Original_height;
 | 
			
		||||
  int  Nb_layers;
 | 
			
		||||
  char Comment[COMMENT_SIZE+1];
 | 
			
		||||
  byte Background_transparent;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user