<commit_before>
// Constant
var view_margin = 50;
var ui_height = 92;


// Local variables
var win      = $( this );
var header   = $('.ui-header');
var uiImages = $('.weevisor-images');
var picIndex = -1;
var pictures = [];

// Load structure
if( params && params.command === 'openFile' ){

  wz.fs( params.data, function( error, structure ){

    structure.getFormats( function( error, formats ){

        structure.formats = formats;

        var metadata    = structure.formats.original.metadata;
        var width       = parseInt( metadata.exif.imageWidth, 10 );
        var height      = parseInt( metadata.exif.imageHeight, 10 );
        var widthRatio  = width / ( wz.tool.desktopWidth() - ( view_margin * 2 ) );
        var heightRatio = height / ( wz.tool.desktopHeight() - ( view_margin * 2 ) );

        if( widthRatio > 1 || heightRatio > 1 ){

            if( widthRatio >= heightRatio ){

                width  = wz.tool.desktopWidth() - ( view_margin * 2 );
                height = height / widthRatio;

            }else{

                width  = width / heightRatio;
                height = wz.tool.desktopHeight() - ( view_margin * 2 );

            }

        }

        win.css({
          'width'   : width + 'px',
          'height'  : height + ui_height/2 + 'px'
        });

        win.addClass('dark');
        win.css({'background':'#2c3238'});
        $('.weevisor-content').css({'background':'#3f4750'});
        start();

    });

  });

}
<commit_msg>Updated to the last API<commit_after>
// Constant
var view_margin = 50;
var ui_height = 92;


// Local variables
var win      = $( this );
var header   = $('.ui-header');
var uiImages = $('.weevisor-images');
var picIndex = -1;
var pictures = [];

// Load structure
if( params && params.command === 'openFile' ){

  api.fs( params.data, function( error, structure ){

    structure.getFormats( function( error, formats ){


      structure.formats = formats;

      var metadata    = structure.formats.original.metadata;
      var width       = parseInt( metadata.exif.imageWidth, 10 );
      var height      = parseInt( metadata.exif.imageHeight, 10 );
      var widthRatio  = width / ( api.tool.desktopWidth() - ( view_margin * 2 ) );
      var heightRatio = height / ( api.tool.desktopHeight() - ( view_margin * 2 ) );

      if( widthRatio > 1 || heightRatio > 1 ){

        if( widthRatio >= heightRatio ){

          width  = api.tool.desktopWidth() - ( view_margin * 2 );
          height = height / widthRatio;

        }else{

          width  = width / heightRatio;
          height = api.tool.desktopHeight() - ( view_margin * 2 );

        }

      }

      win.css({
        'width'   : width + 'px',
        'height'  : height + ui_height/2 + 'px'
      });

      win.addClass('dark');
      win.css({'background':'#2c3238'});
      $('.weevisor-content').css({'background':'#3f4750'});
      start();

    });

  });

}

{'fraction_non_alphanumeric': 0.1545827633378933, 'fraction_numerical': 0.017783857729138167, 'mean_word_length': 2.0660377358490565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1252396', 'n_tokens_mistral': 957, 'n_tokens_neox': 867, 'n_words': 206}