mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-17 17:51:13 +00:00
State filesizes in proper SI-notation.
This commit is contained in:
parent
3e6863c2ad
commit
3df044e3ff
|
@ -56,10 +56,10 @@ files.each { | file|
|
|||
totalSavedBytes = totalSavedBytes + savedBytes
|
||||
totalSavedFiles = totalSavedFiles.succ
|
||||
output = `mv "#{file}.new.png" -v "#{file}"`
|
||||
puts ",\nsaved: #{savedBytes} bytes, total saved: #{totalSavedBytes/1024} KB"
|
||||
puts ",\nsaved: #{savedBytes} bytes, total saved: #{totalSavedBytes/1024} KiB"
|
||||
else
|
||||
File.unlink("#{file}.new.png");
|
||||
end
|
||||
}
|
||||
|
||||
puts "\ntotal saved: #{totalSavedBytes/1024} KB, #{totalSavedFiles} files\n";
|
||||
puts "\ntotal saved: #{totalSavedBytes/1024} KiB, #{totalSavedFiles} files\n";
|
||||
|
|
|
@ -90,8 +90,8 @@ Select the add-on you want to install from the list and click "OK". The download
|
|||
w("<td><b>%s</b><br/>" % name)
|
||||
w("Version: %s<br/>" % v("version", "unknown"))
|
||||
w("Author: %s</td>" % v("author", "unknown"))
|
||||
MB = 1024 * 1024
|
||||
w("<td>%.2fMB" % (float(v("size", "unknown")) / MB))
|
||||
MiB = 1024 * 1024
|
||||
w("<td>%.2fMiB" % (float(v("size", "unknown")) / MiB))
|
||||
if url:
|
||||
link = url.rstrip("/") + "/" + v("name") + ".tar.bz2"
|
||||
w("<br/><a href=\"%s\">download</a></td>" % link)
|
||||
|
|
|
@ -898,7 +898,7 @@ void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* ex
|
|||
int size = disp.screenshot(filename, map_screenshot);
|
||||
if (size > 0) {
|
||||
std::stringstream res;
|
||||
res << filename << " ( " << size/1000000 <<" "<< (size/1000)%1000 << " KB )";
|
||||
res << filename << " ( " << size/1000000 <<" "<< (size/1000)%1000 << " kB )";
|
||||
gui::dialog(disp,_("Screenshot done"),res.str(),gui::MESSAGE).show();
|
||||
} else
|
||||
gui::dialog(disp,_("Screenshot failed"),"",gui::MESSAGE).show();
|
||||
|
|
|
@ -974,7 +974,7 @@ std::string get_bandwidth_stats(int hour)
|
|||
|
||||
ss << "Hour stat starting from " << hour << "\n " << std::left << std::setw(bandwidth_stats::type_width) << "Type of packet" << "| "
|
||||
<< std::setw(bandwidth_stats::packet_width)<< "out #" << "| "
|
||||
<< std::setw(bandwidth_stats::bytes_width) << "out kb" << "| "
|
||||
<< std::setw(bandwidth_stats::bytes_width) << "out kb" << "| " /* Are these bytes or bits? base10 or base2? */
|
||||
<< std::setw(bandwidth_stats::packet_width)<< "in #" << "| "
|
||||
<< std::setw(bandwidth_stats::bytes_width) << "in kb" << "\n";
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ foreach my $campaign (@sorted) {
|
|||
$size += 512;
|
||||
$size -= $size % 1024;
|
||||
$size /= 1024;
|
||||
push @row, escapeHTML("$size KB");
|
||||
push @row, escapeHTML("$size KiB");
|
||||
push @row, escapeHTML($campaign->{'attr'}->{'downloads'});
|
||||
push @rows, td(\@row);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ optimize_imgfile()
|
|||
total_savings_size=$((${total_savings_size}+${png_savings_size}))
|
||||
total_savings_filecount=$((1+${total_savings_filecount}))
|
||||
mv -f ${1}.new ${1}
|
||||
echo " saved: ${png_savings_size} bytes, total saved: $((${total_savings_size}/1024)) KB"
|
||||
echo " saved: ${png_savings_size} bytes, total saved: $((${total_savings_size}/1024)) KiB"
|
||||
else
|
||||
rm -f ${1}.new
|
||||
echo " already optimized"
|
||||
|
@ -106,9 +106,9 @@ print_statistics()
|
|||
# Print overall statistics
|
||||
if [ "$total_savings_filecount" -gt 0 ]; then
|
||||
echo "Overall statistics (only for files with a smaller recompressed size):"
|
||||
echo " Original size: $((${total_original_size}/1024)) KB on ${total_savings_filecount} files"
|
||||
echo " Optimized size: $(((${total_original_size}-${total_savings_size})/1024)) KB"
|
||||
echo " Total saving: $((${total_savings_size}/1024)) KB = $((${total_savings_size}*100/${total_original_size}))% decrease"
|
||||
echo " Original size: $((${total_original_size}/1024)) KiB on ${total_savings_filecount} files"
|
||||
echo " Optimized size: $(((${total_original_size}-${total_savings_size})/1024)) KiB"
|
||||
echo " Total saving: $((${total_savings_size}/1024)) KiB = $((${total_savings_size}*100/${total_original_size}))% decrease"
|
||||
else
|
||||
echo "No files were recompressed."
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user