How can we find out the size of the desired file. What is the meaning of information and how to determine the file size or folder? How to find out how much a file or folder weighs

You probably heard such expressions as "My toy too much weighs", " easy file", Heavy folder." Do you really need folders and files to weigh? And in what units then weighed? Yes, as it does not sound strange, but files and folders also have their own weight, or more correctly - volume. If they were not wearing anything, we would not need hard drives, and release a place for other information.

Even information can be measured. To do this, in computer terminology adopted their units: bytes, kilobytes, megabytes, gigabytes, terabytes, and so on. All computer information Recorded with 0 (zero) and 1 (units). Zero and unit in the computer language are 1 batch. A group of eight bits is called byte. Read more.

Basic information storage units:

1 byte\u003d 8 bits

1 kilobyte (KB) \u003d 1024 byte

1 megabyte (MB) \u003d 1024 kilobytes

As the computer works in binary system (1 and 0), then it is much more convenient to break the information that way. Figure 1024 is kilobyte, and one kilobyte in a binary number system is 2 10 \u003d 1024. We use you decimal system Number, therefore, not familiar to operate in such numbers.

Any file (graphic, musical, video, etc.) has its size. All information in the computer is recorded on hDDwhich has a certain volume. Computer memory It is also measured in these units.

Any information medium, such as: hard disk, floppy disk, flash drive, memory card and CD / DVDs have its own volume, which is not able to write it on it.

How to find out how much a file or folder weighs

In order to find out how much a file or folder weighs, you need to go to the file (or folder) cursor and wait a couple of seconds until the window will come up with information.

If the folder or file is too large, then in this way you will not recognize information about its (it) size. In this case, you need to click on the folder or file right-click, select in the drop-down menu Properties (at the very bottom), and see the size in a new window on the tab General.


Probably, you often see on the sites signature with the file size. Nobody signs this indicator itself. This issue is solved by writing a function on PHP. As a result, it will remove the line of the form:

File size: 2.3 MB
Very convenient if you download any materials from the site. So, proceed.

Create PHP function defining file size

The function will be quite simple and understandable. Uses three built-in functions:

file_exists - check for availability specified File or catalog.

filesize - Determine the file size. Returns the result in bytes. If the file is more than 2 GB, then, depending on the server, it may output an incorrect result.

round. - Built-in function, shortening the output values \u200b\u200bup to an integer and one tenth after the separation sign of the point.
The function checks the presence of the file itself, then successively attempts to determine how large the file size is if more than 1024 bytes, the result should be displayed in MB, if more than 1024 MB, then it should be displayed in GB. And at the end of each stage, the built-in Round function rounds the result from a variety of numbers to the whole value and one tenth with a dividing sign.

Now create a function file. Similar files are customary to keep in separate folder. for example function..

PHP code (file function.php.)

// function arguments will be the path to the file
FUNCTION GET_FILESIZE ($ File)
{
// Go File
if (! File_exists ($ File)) Return "File not found";
// Now define the file size of several steps
$ filesize \u003d filesize ($ File);
// if the size is greater than 1 kb
if ($ Filesize\u003e 1024)
{

// If the file size is more kilobyte
// then it is better to display it in megabytes. Recounting in MB
if ($ Filesize\u003e 1024)
{
$ filesize \u003d ($ FilesIze / 1024);
// And if the file is more than 1 megabyte, then check
// is it no more than 1 gigabyte
if ($ Filesize\u003e 1024)
{
$ filesize \u003d ($ FilesIze / 1024);

RETURN $ FILESIZE. "GB";
}
ELSE.
{
$ Filesize \u003d Round ($ Filesize, 1);
RETURN $ FILESIZE. "MB";
}
}
ELSE.
{
$ Filesize \u003d Round ($ Filesize, 1);
RETURN $ FILESIZE. "KB";
}
}
ELSE.
{
$ Filesize \u003d Round ($ Filesize, 1);
RETURN $ FILESIZE. "Byte";
}
}
?>
We created a function. Next remains to apply it.

PHP code

include_ONCE "FUNCTION / FUNCTION.PHP"; // Connect the file with the function

// Insert the path or variable with the way to process it with the function
$ size \u003d get_filesize ("images / photo.jpg");
Echo "File Size: "$ Size.""; // Display the result with the size
?>
All is ready! Use on health!
Thanks for attention! And good luck in your work!

I suggest to consider what kind of animals are the formats of photos of JPG and RAW, to which they affect and when to pay attention to them. What is the size of the photo and the weight of the file, as they measure and depends on.

Almost all photo cameras can save photos in JPG format (even cameras of phones and tablets). In all mirror and without mirror cameras, as well as in advanced compacts, in addition to JPG there are, at least, Raw and Raw +, and sometimes TIFF.

To deal with formats, first you need to agree, which is meant by the concepts of "size" of photographs and the "weight" of the file (photos). I propose to consider these concepts on more tangible objects ... for example, for goodies.

1 | What is a pixel:


The size of objects is measured in meters, the size of the photo is in pixels (PX).

If you measure the size of this vase with berries, then it will be somewhere 10 centimeters in the height and soak of centimeters 13 wide ... approximately. That is, we are accustomed to measuring items by centimeters (meters, kilometers and so on). If we talk about the photo of the same vase, then the initial size of the photo is 7360 pixels (PX) in the width of 4912 pixels (PX) in height. This is the maximum size of the photo, which is capable of my Nikon camera. To accommodate this photo on the site, the size of the photo is reduced to 1200px at 798px (why, I will tell a little later).

What is a pixel? Made by digital cameras or digitized pictures on the photo scanner are a combination of tiny color squares - pixel. If you increase any photo much, you will see these pixels. The more in the photo of such pixels, the more detailed picture.


An increased photo fragment is a thousand times - the squares of pixels are visible.

2 | Is it possible to translate pixels to centimeters:

This is what happens when you need to print photos on paper. Here you will need another indicator - the pixel density (permission), which the printer will be able to print (or another photo printing machine). Printing standard for photos is a 300 DPI resolution (DPI - the number of points per inch). For example, it uses a photo with a resolution of 300 dpi to print in beautiful glossy magazines.

So that you do not break your head over the size of the photo size on the resolution and did not translate inches into centimeters, in any program to view and edit the photo (for example, in Photoshop) there is a photo size photo viewing feature in centimeters. You will need it to understand what the maximum size of the photo in good quality (with a resolution of 300 dpi), you can print on paper or other material carrier.

For example, this is a photo with tropical flowers of Frangispan, you can print with a size of 61 cm by 32 cm.


Size photo in pixels and centimeters in pHOTOSHOP program

To find out the size of the photo in pixels and centimeters In Photoshop, you need to click the Alt + Ctrl + i key combination or enter the Image (Image Size) menu.

Let's return to the reality of digital photos - to pixels and sizes of photos in pixels. What happens if you reduce the number of pixels in the photo? The answer is to worsen the quality of photography. For example, I took the photo of the same vase with berries, which at the beginning of the article, and reduced the size of the photo to 150 pixels wide. With such a decrease, the program destroys part of the pixels. The photo has become a miniature:

Now let's try to "stretch" photos of the entire page:


The stretched picture looks muddy and fetus

As you can see, the detail is not the same, since some pixels (and with them and parts) is absent.

Of course, if you use this reduced picture as a small icon or a small image in POWER POINT presentation, it will look quite normal, but it is clearly not suitable for printing in a magazine.

3 | What is the size of the photo (how many pixels) is optimal:

If you plan to ever print photos, then keep photos in the maximum possible resolutionwhich will allow your camera (carefully read the instructions for your camera to properly configure the size of the photo).

In some cases, you need to reduce the size of photos. As I wrote above, for the site I reduce the size of a photo of up to 1200 pixels along the long side. If you download the photo in full, the site pages will be loaded very long, and this may not like many visitors (not to mention the search engines Google and Yandex).

Photo size is measured in pixels (PX). The size of the pixels depends the size of the photo on the monitor screens, and what size can be printed by a photo.

4 | File size or "Photos of photos":

Now we will deal with the "Weight of the Photos". So historically it happened that in this matter a lot of confusion and the file size is quite often called "weighing photos", which is rather convenient than right. File size is measured by megabytes (MV) or kilobytes (KV). And here it is worth remembering that, unlike kilograms, where 1 kg \u003d 1000g, 1 megabyte \u003d 1024 kilobytes.

As it looks in practice: I will present a situation that in your camera there is a memory card on which 64GB (gigabyte) is written. If you see how much exactly the bytes are there (on the computer right-clicking, select "Properties"), it turns out that on this memory card 63567953920 byte and this is 59.2 GB. From how much big files Creates your camera depends on how many photos fit on this memory card. For example, I have 830 files from the photo in rAW format (read about formats below).

From what fastened the size of the file:

  • First, from the size of the photo (that the pixels is measured): the file with the first photo of the berry (the size of the photo 7360x4912 px) is 5.2 MB, and it, reduced to 150 Px, will "weigh" 75.7 kV (in 69 times less).
  • Secondly, from the format (JPG, TIFF, RAW), as read below.
  • Thirdly, the file size (or "the weight of the photo") depends on the number of parts: what is more, the more heavier photography (which is most relevant for the JPG format).

Many details - more weight photos

For example, in this photo with monkeys from Sri Lanka, many small clear (speaking of photographers, "sharp") details and file size with this photo - 19.7MB, which is significantly more than berries in a vause on a white background (5.2MB).

If you ask, what size photo I can print from a photo that weighs 2mb. No one can answer until the number of pixels recognize. And better, of course, also look at the photo, as some craftsmen love to get a photo from the depths of the Internet, to increase the number of pixels programmatically, and then want to type it on the magazine. It turns out as an example above with a stretched photo of a vase 150 px wide.

File size (often referred to as the "weight of photographs) is measured in megabytes (MV) or kilobytes (KV) and depends on the format, size in pixels and detoxia photos.

5 | Photo formats:

And, finally, we approached the question of image formats and the type of file compression, from which the size of the file with the photo also depends.

Almost all photo cameras can save photos in jPG format (Even the cameras of phones and tablets). This is the most common image format and "understand" all computers and programs for viewing images. In JPG format, photos can be downloaded to social network, lay out in the blog, add to word files, POWER POINT and so on. JPG can be processed in photoshop, lightrum and other images for editing images.

From my practice: if I want to make a photo for the social network and quickly download it, then I either photograph the format of the JPG file in my camera.

What is worth remembering the JPG format is a compressed format and it has a compression degree. The higher the degree of compression, the smaller the file size by reducing the detail and quality of the photo. Therefore, it is not recommended multiple editing and recovery (re-compression) of the same photos in JPG format.


When saving a file in the JPG format, a compression ratio is selected (an example from Photoshop program).

In all mirror and without mirror chambers, as well as in advanced compacts, in addition to JPG there are at least Raw, and often TIFF.

A bit of theory:

  • TIFF. (English Tagged Image File Format) - Raster storage format graphic images (including photos). TIFF has become a popular image storage format with great color depth. It is used in printing, is widely supported by graphic applications.
  • Raw. (English. Raw - trip, untreated) - the format of a digital photo containing the raw data obtained from the photomathica (such that in digital cameras replaced the film).

Personally, I never take pictures in tIFF format. I can not even come up with why I need it, if there is RAW. TIFF without compression I can use to save the photos that I still plan to finalize in Photoshop.

6 | Advantages and disadvantages of RAW format:

I almost always have a Raw format in my camera, since I'm going to handle (edit) a photo in Lytrum or Photoshop. Raw has a number of significant drawbacks:

  • There is no possibility of viewing files without prior conversion. That is, to view the photo in the RAW format you need special programSupporting this image format.
  • Larger files than when saving in JPEG (with my Nikon D800 camera, the file size with a photo in RAW format is 74-77 MB). This means that few photos fit on the flash drive.
  • RAW cannot be downloaded in social network, blog, and sometimes even send by mail. At first, the RAW must be converted to the RAW converter (for example, Adobe Camera RAW), which supports the type of file from your camera model.

Why do professional photographers often prefer Raw, and not jpg? Because Raw:

Save this article for memory in Pinterest
  • gives more possibilities For image correction: White, contrast balance, saturation, brightness and noise level,
  • allow you to better adjust the pictures without the appearance of defects,
  • allows the thin correction of lens deficiencies (vignetting, chromatic aberrations).

So, if you plan to thoroughly process snapshots in Photoshop or Lightrum, finely feeling "artifacts" and halftone, "reversals" and "failures" in the shadows, then remove in Raw. Just remember that to get a good result, you will need to deal with settings and work. Raw converters. Think if you need this headache? Maybe you should shoot in JPG and pay more time to rest, not a computer?

In this article, I wanted to introduce my readers with the concept file size, folders, or even programs (given that the program is a set of folders and files).

Any file or folder with files takes on local disks Certain memory. That is, all files and folders have a volume, in other words, weight or size.

From school we know such concepts as grams and kilograms, meters and kilometers. The computer world also has its own units of measurement. They measure files and folders. Relying on the "slang" of advanced users, we will determine how much a file or folder "weighs". The main units of measure are: bytes, kilobytes, megabytes, gigabytes, well, you can also terabytes.

1 kb \u003d 1024 byte

1 mb \u003d 1024 kb

1 GB \u003d 1024 MB

Decipherate:

In one KB (kilobate) there are 1024 bytes.
In one MB (megabay) there are 1024 KB (kilobyte).
In one GB (Gigabay) there are 1024 MB (megabyte).

How to find out file or folder size?

In order to find out the file size or folder with files, hover over or folder the cursor and hold for a few seconds. A small window appears with a file characteristic or folder, one of the parameters is the size.

If you do not appear on the file or folder, then click right button Mice on this file or folder. From opening context menu Select "Properties".

A window will open, in which the size of this file or folder will be specified.

Why do we need to know the sizes?! For example, in order to determine if we can write a file or folder to the disk (floppy disk, flash drive) or how much space remains on local disks.

In order for us to determine this, we need to know how much information is placed on the disk (floppy disk, flash drive):

  • Diskettes - 1.44 MB (suitable for writing text files)
  • CD drive - 700 MB (suitable for recording music, small videos and programs)
  • DVD Disc - From 4 GB (suitable for writing anything). The standard DVD disc is 4.7 GB. There are two-sided DVDs. This means that the record can be on both sides - and with one, and from the second. These discs have a volume of 9.4 GB. There are also two-layer discs, but they are less common. These discs are the following: 1-sided 2-layer - 8.5 GB; 2-sided 2-layer - 17.1 GB.
  • Flashki - from 1GB (suitable for writing anything)

That's all I wanted to tell in this article.

If we talk about information in general, it is measured in bytes. The measurement in these units began from the distant 1956. Then this magnitude was enough. So that it was clear what kind of magnitude it is spent, I will tell you that 1 byte \u003d 1 symbol. With the development of technologies, the amount of information increased, and it became not convenient to measure a large amount of information in bytes. Then appeared consoles of Kilo-Byte (KB), mega-byte (MB), Giga-byte (GB), tera-byte (TB), etc.

To understand how big or small these values, I will give such a comparison:
- 1kb (one kilobyte) \u003d 1024 bytes, and this is the amount of information in approximately one printed list of A4th format;

- 1MB (one megabyte) \u003d 1024 kilobytes, and this is the amount of information already a decent tomb of pages to 600-700!

- 1GB (one gigabyte) \u003d 1024 megabytes, and this is already a whole library out of 1024 books for 600 pages!

- 1TB (one terabyte) \u003d 1024 gigabytes, this amount of information is comparable to the Middle European Library, which contains about 8 million books. For example, in the Russian State Library there is about 43 million units.

Now compare the volume and type of information regarding media to which this information can be recorded.

- Diskette with a capacity of 1.44MB. Once the diskette was the main available carrier digital informationbecause Write on it could have been really a lot of things. Now the diskettes are used mainly accountant for storage. electronic keys and signatures. Cause Banalna - On a diskette of little storage space modern information. On a floppy disk, you can write one, two photos made on mobile phone with 3 megapixel chamber; Five, ten Word, Excel documents.

- USB flash drive with a capacity of 1GB. The most convenient medium of information today. The capacity of the 1GB flash drive I took for the multiplicity of the account, and in general, at the time of writing an article there are 64GB flash drives!
What can be written on a 1GB flash drive: one film, relatively good quality; About 200 music files in format.mp3; About 200 photos good quality; Many documents and short programs.

- CD 700MB CD. On the CD, the disc can be written: one film in format.avi, in relatively good quality; about 150 music files in format.mp3; about 150 photos of good quality; Many documents and short programs.

- DVD disk with a capacity of 4,7gb. On a DVD, you can write: one movie in DVD or HDTV format; 4-5 films in the format.avi of good quality; about 1,200 music files in format.mp3; About 1000 photos of good quality; Soooo many documents and programs.

- Winchester with a capacity of 120GB. Here, not to paint to documents, compare with the number of films that can be written to such a hard drive. So, on the 120 GB hard drive can be written 25 films in DVD or HDTV quality!

Now let's figure out how to determine the size of the disk, file or folder.
In Windows, determine the size of the file, folder or disk in the conductor. You can run the "Explorer" by clicking two times the left mouse button on the "My Computer" label on the desktop or using the Win + E key combination.

If you, for example, want to know how much free space is left on the disk, in particular on a flash drive, you click on the right mouse button on the image of a removable disk, it is usually signed as " Removable drive (F :) "or" The name of the flash drive (F :) ", as in the picture:

So, click on the right mouse button on the image of a removable disk - flash drives and choose the "Properties" item in the opened menu, at the very bottom. After that, the window opens:


It can be seen how much is occupied (highlighted blue), how much freely (highlighted pink) and how much space on the disk.

Thus, you can find out the residue of free space not only on the flash drive, but also on any removable or logical disk Winchester.

The scheme for determining the file size or folder is the same as with a disk. Those. Find the desired file or folder on the disk, click on it (s) with the right mouse button and see "Properties".


There will be all the necessary information.


If you want to know the size of a group of files or folders, they need to be highlighted and do the same operations, i.e. Click right-click on one of the selected files or folders, select "Properties" and view the size.

Yes, the second part of the lesson does not quite fall into the "Computer Ase" rubric, but nevertheless. If you have any questions, you can always ask them in the comments.