I know what size it is, but what size will it be?
May 11, 2018 3:01 PM   Subscribe

I would like to be able to single-click to select (not double-click to open) an image file in Windows Explorer and have the print dimensions displayed. Is there a plug-in or add-on to do this?

Google is failing me (or I'm failing me) on this one so here we are. Right now in Windows Explorer I can View -> Details Pane and when I select an item it shows me all sorts of data including pixel dimensions and filesize. I'm doing a task where I have to use a site like this one to say "okay if it's 1010 x 984 pixels then if were were to print it at 300 DPI that'd come out about 3.37" x 3.28"." I'd really like to streamline this process and stop having to hop to a new tab in my browser - to reduce the risk of human error at the very least.

To summarize: I'd like to select an image from within my file browser and have displayed the approximate print dimensions at 300 DPI without having to double-click and open the image.
posted by komara to Computers & Internet (12 answers total) 1 user marked this as a favorite
 
Are you committed to doing this in Explorer, or are you comfortable doing it from the command line?
posted by jeffamaphone at 4:01 PM on May 11, 2018


In the Windows Explorer window on Windows 7, at the top there are a bunch of categories like the filename, date modified, file type, file size, etc. You can right-click, choose "more" and then from a long list check off "dimensions" and it will show you the dimensions in the folder view without having to open the file.
posted by AppleTurnover at 4:03 PM on May 11, 2018 [5 favorites]


AppleTurnover's solution will give you the 1010 x 984 part but not the print dimensions. I have no idea how to do that because of the variability of print resolution.
posted by irisclara at 6:20 PM on May 11, 2018


Response by poster: > Are you committed to doing this in Explorer, or are you comfortable doing it from the command line?

comfortable-ish. I mean I have zero issues with using the command line. It's just alt-tabbing to the web form where I have to submit these images (and their expected-ish print dimensions) and then back. If I'm having to run a new command every time and remember or tab-to-complete filenames one at a time, that's a no-go.

If you're about to tell me some thing I could do in an ImageMagick-like that would output a list of image files and their dimensions to a text file I could just open in Notepad ... I'm all ears.
posted by komara at 7:01 PM on May 11, 2018


If you write a cmd script, you can pass any number of filenames to it at once, just by dragging the files and dropping them on the script. And a cmd script can contain a PowerShell script, and PowerShell makes assorted kinds of image file manipulation fairly easy.

How would you feel about a workflow where you drag one or more files from some folder and drop them onto a script (or to a desktop shortcut to a script), and you get a temporary CSV file containing all their dimensions that automatically opens in Notepad?

If that works for you, try copying the following and pasting it into Notepad, then saving as dimensions.cmd (when you're doing the Save As, change the Save as type: from Text Documents to All Files, otherwise you'll make dimensions.cmd.txt, which won't work).
<#	:cmd launcher for PowerShell script
@	set ps1="%TMP%\%~n0-%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.ps1"
@	copy /b /y "%~f0" %ps1% >nul
@	powershell -NoProfile -ExecutionPolicy Bypass -File %ps1% %*
@	del /f %ps1%
@	goto :eof
#>

$dpi = 300
$out = [System.IO.Path]::GetTempFileName()
$image = New-Object -ComObject Wia.ImageFile
$Args | % {
	$image.LoadFile($_)
	$w = $image.Width / $dpi
	$h = $image.Height / $dpi
	'{0:f3},{1:f3},"{2}"' -f $w, $h, $_
} >$out
notepad $out
del $out

posted by flabdablet at 9:38 PM on May 11, 2018


Best answer: Playing with that a bit more, it seems that sometimes (but not always) the temp file gets cleaned up before Notepad manages to open it. A horrible kludge involving sleep 1 makes it more reliable (but remember, kids, DO NOT solve race conditions that actually matter this way!)

Also, if the ultimate aim is to paste stuff into a web form, you probably want space separators rather than commas because Notepad's double-click selection support is fairly braindead.
<#	:cmd launcher for PowerShell script
@	set ps1="%TMP%\%~n0-%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.ps1"
@	copy /b /y "%~f0" %ps1% >nul
@	powershell -NoProfile -ExecutionPolicy Bypass -File %ps1% %*
@	del /f %ps1%
@	goto :eof
#>

$dpi = 300
$out = [System.IO.Path]::GetTempFileName()
$image = New-Object -ComObject Wia.ImageFile
$Args | % {
	$image.LoadFile($_)
	$w = $image.Width / $dpi
	$h = $image.Height / $dpi
	'{0:f3} {1:f3} "{2}"' -f $w, $h, $_
} >$out
notepad $out
sleep 1
del $out

posted by flabdablet at 10:08 PM on May 11, 2018


Right click to get the context menu, then Properties and Detail tab.

It's basically a new window and a new tab, but not a browser tab, so I'm not sure if it's what you want or not.
posted by SemiSalt at 10:34 AM on May 12, 2018


Before anybody else gives an answer involving just looking up details in Windows Explorer, please note that komara already knows how to get access to the information that Explorer displays natively for images:

Right now in Windows Explorer I can View -> Details Pane and when I select an item it shows me all sorts of data including pixel dimensions and filesize

What he's specifically asking for is a way to show print dimensions and Windows does not store or display these; they need to be calculated from the pixel dimensions that it does store, and an assumed 300dpi pixel resolution for printing.
posted by flabdablet at 11:03 PM on May 13, 2018 [1 favorite]


Response by poster: > How would you feel about a workflow where you drag one or more files from some folder and drop them onto a script (or to a desktop shortcut to a script), and you get a temporary CSV file containing all their dimensions that automatically opens in Notepad?

How would I feel about it? I would feel exactly like I feel right now after having tested it out - it's fantastic. Thank you very much for taking the time to put this all together for me. I really appreciate it.

You've cut several minutes out of my workflow and saved me a bunch of alt-tabbing and tab switching. Thank you again.
posted by komara at 10:31 AM on May 15, 2018


Once you have these dimensions and filenames, what are you doing with them? PowerShell can automate all kinds of stuff.
posted by flabdablet at 10:34 AM on May 15, 2018


Response by poster: Just typing the print dimension numbers into a clunky government web interface that requires manual interaction at every step beforehand and afterward (after I've attached the image itself). Everything I'm doing is something they could have programmed their interface to do, but it doesn't do.

Unfortunately there's nothing left for me to speed up here.
posted by komara at 1:36 PM on May 15, 2018


Might be worth your while checking your browser's network activity log after you click Attach or Upload or Submit or whatever on that clunky web interface. I've quite often found that it's reasonably easy to work out the pattern behind the requests that a clunky web page actually sends to the server, and automate accordingly.

Best case, you end up with a script that you can drop a pile of images on that automatically logs into whatever web service and uploads them all without further interaction.

Worse case, you learn something. Worth a shot.
posted by flabdablet at 2:18 AM on May 16, 2018


« Older Positive peeps, inspiring tweets   |   Asphalt content for Canada Newer »
This thread is closed to new comments.