How-to: set Cropp-Ratio and DPI in one operation?

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

User avatar
Gerald_Ire
Posts: 67
Joined: Wed Nov 11, 2020 12:37 pm
Location: Germany

How-to: set Cropp-Ratio and DPI in one operation?

Post by Gerald_Ire »

Try to make XnViewMP function as easy as possible - for our "standard user"

work to do:
crop image to 1920 x 1080 with 72 dpi for online publishing...

issue:
set option in CropSize.xmp - but cant set the resolution there...

Code: Select all

...
<item label="1920x1080_Format" width="16" height="9" unit="ratio" ratio="0" visible="yes"/>
<item label="1200x600_Format" width="2" height="1" unit="ratio" ratio="0" visible="yes"/>
...

set option in ResizePreset.txt - but cant set the resolution there...

Code: Select all

...
175%
200%
1920x1080, MainImage
1200x600, TeaserImage
...

workaround:
1) crop image on that 16x9-ratio

20221028_screenshot_002785.png
2) resize image on 72dpi with 1920 x 1080 px - and make sure 72dpi is set

20221028_screenshot_002786.png
Would love to do this in one step... any suggestion?

Any hints?

PS: Happy :twisted: Halloween - enjoy the weekend...
You do not have the required permissions to view the files attached to this post.
Last edited by Gerald_Ire on Fri Oct 28, 2022 1:29 pm, edited 1 time in total.
-------------------------------------------------------------------------------
:D Gerald says thx to all! :D
User avatar
Gerald_Ire
Posts: 67
Joined: Wed Nov 11, 2020 12:37 pm
Location: Germany

Re: How-to: set Cropp-Ratio and DPI in one operation?

Post by Gerald_Ire »

Info: Edit CropSize-xml:

<?xml version="1.0" encoding="UTF-8"?><crop_size version="1.0">
<array>
<item label="1920x1080_Format" width="16" height="9" unit="ratio" ratio="0" visible="yes"/>
<item label="1200x600_Format" width="2" height="1" unit="ratio" ratio="0" visible="yes"/>
</array>
</crop_size>

The "Doctype-Error" in XML is now gone when "label" gets text...
-------------------------------------------------------------------------------
:D Gerald says thx to all! :D
User avatar
Gerald_Ire
Posts: 67
Joined: Wed Nov 11, 2020 12:37 pm
Location: Germany

Re: How-to: set Cropp-Ratio and DPI in one operation?

Post by Gerald_Ire »

Any chance to do this via batch / batch cmd-button?

Cropp has to be manual, but the conversion to 1920x1080-72dpi wont work...
Hotfolder doesnt work the way I think it should...

Cant get this run... :-(
-------------------------------------------------------------------------------
:D Gerald says thx to all! :D
User avatar
xnview
Author of XnView
Posts: 38702
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: How-to: set Cropp-Ratio and DPI in one operation?

Post by xnview »

you can't use same in batch convert?
Pierre.
User avatar
Gerald_Ire
Posts: 67
Joined: Wed Nov 11, 2020 12:37 pm
Location: Germany

Re: How-to: set Cropp-Ratio and DPI in one operation?

Post by Gerald_Ire »

Hi Piere! Thx for reply.

I will try batch again and post my results....
-------------------------------------------------------------------------------
:D Gerald says thx to all! :D
User avatar
Gerald_Ire
Posts: 67
Joined: Wed Nov 11, 2020 12:37 pm
Location: Germany

Re: How-to: set Cropp-Ratio and DPI in one operation?

Post by Gerald_Ire »

I skipped the batch process cause for the whole workflow I/we have to combine two functions with four variables:

1) Resize image: depending on two formats (1920x1080 / 1200x600) or "Longest side" (width or heigth = 4x options)
2) add Canvas Resize - depending on the formats (1920x1080 / 1200x600)

I think IF "Canvas Resize" would have as well the option "Longest side option" it might be done in one step.
What do you think?

Resize with option "Longest side"
20221123_xnviewmp_canvas resize option.png

Canvas Resize without option "Longest side"
20221123_screenshot_003107.png
--------------------------------------------------------------------------------------------------------------------------------------------

And: I found the two "preset voodoo lines" of my changes in xnview.ini (via comparison before & after changes) :-)

[ResizeDlg]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x2\x83\0\0\0\x66\0\0\x3}\0\0\x2\xcb\0\0\x2\ (...)
presets=@Variant(\0\0\0\b\0\0\0\x5\0\0\0\x1c\0T\0\x65\0\x61\0s\0\x65\0r\0H\0\xf6\0h\0\x65\0_\0 (...)
loadDefaults=true

[CanvasDlg]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x2\x83\0\0\0\x66\0\0\x3}\0\0\x2\xcb\0\0\ (...)
presets=@Variant(\0\0\0\b\0\0\0\x3\0\0\0\x1a\0T\0\x65\0\x61\0s\0\x65\0r\0_\0z\0\x65\0n\0t\0\(...)
loadDefaults=true

I can now add this lines in the AppData setup for everyone :-)
Thx for the hint!
You do not have the required permissions to view the files attached to this post.
-------------------------------------------------------------------------------
:D Gerald says thx to all! :D