augras An «horizontal» picture is resized in the Modal window, maybe a vertical also but then only on width.
It doesn't work like that. The modal is limited to a certain width, for functional viewing, and also because that is optimal width for reading the text/data for the file. This width is set to 520px. On small(mobile) screens, the width will be even smaller, but set to 100% device width. Therefore, the image within the modal will shrink with the width of the screen. The width isn't in any way set to "fit inside window", it's just logical that the width is limited.
The height on the other hand, will simply take as much space as required with the image displaying at the given width. We don't scale down the height of the image, because 1. it will look strange, and 2. we don't know how much to scale the height, because of the space in the topbar and margin above, and 3. it will then scale the width. This is how all modal windows work (in all frameworks), because it's logical.
And just to be clear, that is why the popup mechanism is superior for specifically displaying images in full.
augras I understand what you said for the text, but i am talking only about the picture.
This is not logical, and not how modals work. This is how the POPUP works, and why it's assigned for images. If we scale the image to "fit inside height of screen" in the modal, it could look like this:
Not only is it tiny and doesn't look nice, but you are asking to scale only the image, while the rest of the data is accessible only through scroll anyway. This is what the popup is for, which shows when you click the image:
Besides, how do your users access the modal? They need to right-click and select "show info". The only point in doing this, would be if they want to see the extended text-based info about the image, and if this is hidden behind scroll anyway, what's the point? The default popup will display the image best, the optional modal is made to emphasize the text info.