Copy an image's dimensions to the clipboard?

Let's see if anyone can help me with my latest dOpus8 desire.

The ToolTips for image files in Thumbnail view have shown the image's dimensions [53 x 26 x 8 GIF Image] for some time now. With dOpus8 it now does so in any view mode, which is cool. As a web builder I'll regularly navigate to where the image file is, copy the file name, paste it into my text editor, flip back to dOpus to read the image dimensions, flip back to the text editor to type it in [width="53" height="26"] and invariable get something wrong and have to flip back and forth a few more times until I've got it right.

What would really make my day is if I could copy in one action the image file name AND the dimensions and paste something like [whatever.jpg width=574 height=133] into place. Even better would be if I could format it with quotation marks in place ["whatever.jpg" width="574" height="133"] or to specify some default HTML tagging, too []. My thinking is that if dOpus can get the image dimensions so easily, perhaps it can be made to output them to the clipboard for me in a format of my choosing. Even if I could paste something like [whatever.jpg 574 133] I'd be a happy camper. I could add the rest with ease.

Question is, how can this be done, if indeed it can be done? As I browse the dOpus8 PDF manual I find nothing that looks like it might work. The Image raw command doesn't seem to offer anything useful, nor does the Clipboard raw command. I find references here and there to {picsize}, {picwidth}, {picheight} Image WIDTH/K/N, HEIGHT/K/N, but I'm afraid the whole thing is completely over my head. I've attempted dozens of things and have failed an equal number of times.

Before I post this as a feature request for a future dOpus version, does anyone out there with a larger brain than mine have a suggestion that might actually work for me?

Hmm sorry no can do. There is no raw command to read the width and height of pictures. Atleast i was not able to find one.

As a web builder (programmer) myself I'm wondering why you're trying to do this with DOpus? DOpus is amazingly powerful but IMO you're talking about doing something that's better suited for a powerful text editor. There's lots of them out there, for example I use NoteTab Pro which only costs $20 but they have a free version that does the same thing in regards to what you're wanting to do (plus so very much more).


Using the Print Folder function in the default Tools menu you can define any of the columns for the resulting print.

Pretty easy to set it up to print Filename, Width and Height.

Which you can of course output to printer, file or clipboard.

Yeah, I guess I was trying to take too big a bite with this one.

Re: John's reply... I downloaded NoteTab Lite long ago, but for whatever reasons have chosen to stick with EditPad, which is about as basic a text editor as can be found. After reading your reply I opened NoteTab up and played around a bit and have to admit that it is rather slick the way it will open a file requester and paste the selected image into place complete with the width and height. Perhaps I've been too hasty in ignoring NoteTab.

Re: tanis's reply... Although the Print Folder function won't satisfy my desire, I played around with it and was impressed to see what it can do. Funny how I could use dOpus for all these years and completely overlook so many features, this one included.

Re: Littlex's reply... I think you're right. It doesn't look like what I want done is going to be done with the current version of dOpus. But, I'm not one to complain.

Thanks for the replies.

I've been trying to make a command that copies the selected filename and makes an image tag out of it, with the correct height and width attributes. Then use Leo's setclip.exe to put it int he clipboard.

Not had any joy with getting the height/width of the selected file though, bummer.

Might have to write a tool to do it and just use DOPus to launch it.

I'll post here if I do.


This could easily be done with a PHP command line script.
You would need to install PHP to accomplish it though.

Some time ago, I wrote an example PHP command line script in reply to a different topic.

I'd be happy to write a script for you if you'd like to try this.

:opusicon: porcupine

Ok, I've written something to do this.

Select a file and run the command, it puts the following in the clipbard:

Email me if you want it.


Dave/Ben... if you don't mind modifying the actual infotip/tooltip for your image files, then you can copy that to the clipboard:

"{name}" width="{picwidth}" height="{picheight}"

img src="{name}" style="height:{picheight}px;width:{picwidth}px"

Since Opus 8.1 hitting <Ctrl+Shift+C> copies the tooltip info to the clipboard. Unfortunately, I'm not aware of any way of accessing the metadata above from any place OTHER than the tooltip. I also don't know of any raw command to perform the copy - the keystroke combo above seems an internal hard-coded thing... maybe GPSoft will expose it someday via some extensions to the raw Clipboard command.

For your need, you can't use the carrot tags because it screws up Opus infotip handling... but it seems you came up with your own method anyway :slight_smile:.

Hmmm... Good idea Steje !

I'm wondering though why Dave needs to specify width and height at all.
FrontPage for instance does this kind of thing automatically.
However, the simple fact is that unless it's a background image , height and width aren't usually needed at all.
Background images tile.

Perhaps Dave has a valid reason to do this, it does happen, and I only wanted to answer his question.
EXIF data or not, PHP command line scripting could really be a solution to this.

If benbenbenbenben has a real command line program that accomplishes this, GREAT !
Power to Dave !

                               :opusicon: Porcupine

Web pages load quicker/nicer if you specify the image sizes up front. I edit all my HTML by hand in TextPad because I don't like WYSIWYG HTML editors, so a tool which generates the img tags including width and height would save a lot of hassle.

! this sounds good:

unfortunately it doesnt on mine ... (version
(Im sure im somehow the cause of that ...) :smiley:
Could someone give me the function\command to go with that shortcut?

I don't think it's actually a command as such - more a built in function. It does work with but you may be misunderstanding its use.

You need to have the tooltip displaying to copy it's information. Therefore, hover the mouse over an image file and once the popup shows - then hit <CTRL+SHIFT+C> to copy the information to the clipboard.

I know I'm getting way off topic, but in response to what you wrote here Leo FWIW I've been hand writing all my html etc for 10 years or so, the last 7 using a programmable text editor called NoteTab Pro. It can do exactly what you stated and just about anything else I want to do with text. For example I programmed NoteTab to automatically insert all the image code required in an html document, including size. I just open a dialog box, browse to the image I want and press ok and voila, it's inserted into the html file with all the correct code. Same for links, creating tables and anything else. Recently I used NoteTab to make a change in 300 html documents, one line of code required changing in every page. Total time to make the changes? About 15 seconds. You can build the NoteTab program to do exactly what you want it to do using it's internal scripting language which is very powerful.

I also have the current version of UltraEdit and I've given Vim a try now and then, but 99.9% I use NoteTab for anything involving text (including writing this message as I programmed it to be a word processor too).

NoteTab has two disadvantages to it though.

  1. There hasn't been a major update to the program since 1999.

  2. It's not unicode compliant.

But in spite of that if I sound high on NoteTab, it's because I am. By far it's the best 20 dollars I have ever spent on software.

Now back to your regularly scheduled thread. :smiley:

yesno tanis!
the problem(s) was I didnt understand but ALSO, I had used this shortcut for something else (as it wasnt previously shown in the shortcut list ~ thats happened me before ... )
got it going now anyways, thanks!

Oh I don't know John... I wouldn't say it's terribly off topic. You've got good reasons to suggest something you've found to work well in these cases... It would be nice though if the discussion helped to open the door a bit on Opus built-in clipboard capability. I can think of several occasions where I would like to have had access to a number of different pieces of meta-data info that I could send right to the clipboard. And as Tanis pointed out - you have to actually have the info tip showing for it to work - a caveat I did not realize...

I know these posts are years old now, but I thought I'd give my overview of how I've incorporated everyone's input into what I now routinely do to copy an image file name and its dimensions to the clipboard. I've opted to go with steje's suggestion to modify the actual infotip/tooltip for all image files in dOpus.

Here's the process...

  1. Select the menu item: "Settings"
  2. Select sub-menu item: "File Types..." (The "File Types" window opens)
  3. Select "[+]File Type Groups"
  4. Double-click (or click the "Edit" button): "(NONE) Images" (The "Edit 'Images' File Type Group" window opens)
  5. Select the third tab: "Info Tip"
  6. Type the following into the "Info Tip definition" textarea...
    img src="{name}" width="{picwidth}" height="{picheight}" alt="" />{thumbnail}

Now the Info Tip for an image file will show something like...
img src="whatever.jpg" width="500" height="355" alt="" /> (followed by the thumbnail)

Ctrl+Shift+C will copy into the clipboard (while the Info Tip is showing)...
img src="whatever.jpg" width="500" height="355" alt="" />

All I have to do is type the left angle bracket (<) into my text editor and paste the rest.

The "Info Tip definition" will not accept a leading left angle bracket (<), but it will take the right angle bracket and the slash before it.
Put a leading left angle bracket there and the entire Info Tip will be empty. Only the thumbnail image will be displayed.
I know of no escape character that will allow left angle bracket to be included. I've tried everything I can think of.

Obviously, I could easily modify the "Info Tip definition" in a number of ways...
img id="" src="../images/{name}" style="width:{picwidth}px; height:{picheight}px;" alt="{name}" border="0" />{thumbnail}
Adding more will make the Info Tip so long as to become really annoying.
Besides, I'm really only after copying the image name, width and height.
Subsequent modifications to that text is no problem.
I'm using dOpus9 now, by the way, where it continues to work just fine.

Thanks to everyone that threw in their two cents worth for me.

Never heard of this anywhere and I'm a web developer. Do you have any references about it? In any case the only use would be for specifying element sizes to match background images in CSS.

I prefer Notepad++ myself. IMO it's the best text editor for Windows.

I can vouch for what nudel said in your quote kasakka and my primary reference for saying that is the CSE HTML Validator Pro program which I use to validate all my web sites (also a web developer here).

I'm very glad DaveTheSlave has found a nice workable solution.
Good Work Dave !

This thread is very old now.
Without looking into when the Directory Opus update that made Dave's solution possible was posted,
I can't comment in hindsight about what was said.


I just HATE WYSIWYG HTML editors.
However, I must admit I stopped thinking at all about them after using FrontPage 2000 for a short time.
Very offending to me was the FrontPage Form generation.
FrontPage's placement of the tag in the html sequence rsulted in Ugly Thick wasted space around the element.


[quote]In any case the only use would be for specifying element sizes to match background images in CSS.
Really !
Suppose we want to make a vertical line.
If we have a 1 pixel x 1 pixel image of any color,
we could do this:

<img src=icons/dot_black.gif width=2 height=113 >

To take this a bit further, suppose we have a cell that we wish to write some text into.
Let's also put a thumbnail image of size 120 x 90 in the upper right hand corner.
Below this image, let's write a caption for the image.

To make it even more interesting, we'll put our vertical line to the left of both the thumbnail and the caption.
Let's write text in the cell that will wrap around the image stuff .



I'm not certain if I needed the width=120,
but it's good to have it here as it needs the proper vertical line height.

My HTML has never passed ANY validator !