problem with import

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
porrier

problem with import

Post by porrier »

Hello!

For years I used the follwing line to make a screenshot of parts of the screen:
import ~/shot-`date "+%Y-%m-%d_%H:%M:%S"`.jpg

Now I changed to an openSUSE 11.3 with import
Version: ImageMagick 6.6.1-0 2010-05-10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

and get broken images. import x.jpg works but not the string above. What is wrong?
It must have something to do with the date part of the string.
Can somebody help?

Kind regards

Andreas
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: problem with import

Post by anthony »

What is that '-' looks like a UTF character to me!
The date is a separate command and should not be relevant.

The import command is working for me.
But you can also try...
convert x: image.jpg

It may be that you are using special X window handling Hmmm.. "compbiz" or something like that to do fancy high speed screen and window effects. This may not be readable from the X server import, and could be the cause of the problem.

I can't for example take X window snapshot of 'video' in a video player! Though the player itself can take snapshots of the video frame more directly (it doesn't snapshot the display but what it is displaying).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
porrier

Re: problem with import

Post by porrier »

anthony wrote:What is that '-' looks like a UTF character to me!
The date is a separate command and should not be relevant.

The import command is working for me.
But you can also try...
convert x: image.jpg

It may be that you are using special X window handling Hmmm.. "compbiz" or something like that to do fancy high speed screen and window effects. This may not be readable from the X server import, and could be the cause of the problem.

I can't for example take X window snapshot of 'video' in a video player! Though the player itself can take snapshots of the video frame more directly (it doesn't snapshot the display but what it is displaying).
You mean the '-' after 'shot'?

convert x: shot-`date "+%Y-%m-%d_%H:%M:%S"`.jpg
opens the image with ImageMagick on the screen but does not save it to disc.
what does the x: do?

compiz is not installed. I do not need this date-string really, just wondering why
it does not work with kde4.

Greetings

Andreas
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: problem with import

Post by anthony »

I meant the - before the "/shot"

An alturnative test of importing from your display without using ImageMagick is...

xwd | xwud

the first grabs the window (or whole screen if the window is root) as a xwd image, the second just displays it. If that doesn't work it would explain why IM can't import!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
porrier

Re: problem with import

Post by porrier »

anthony wrote:I meant the - before the "/shot"

An alturnative test of importing from your display without using ImageMagick is...

xwd | xwud

the first grabs the window (or whole screen if the window is root) as a xwd image, the second just displays it. If that doesn't work it would explain why IM can't import!
before the /shot that it is a ~
but the image is broken just with import shot-`date "+%Y-%m-%d_%H:%M:%S"`.gif nevertheless.

xwd | xwud works and grabs the window or the whole screen.

Greetings
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: problem with import

Post by magick »

Try this command:
  • convert x: jpeg:shot-`date "+%Y-%m-%d_%H:%M:%S"`.jpg
porrier

Re: problem with import

Post by porrier »

magick wrote:Try this command:
  • convert x: jpeg:shot-`date "+%Y-%m-%d_%H:%M:%S"`.jpg
Yes, this works within windows or the desktop. Across windows, there is some
black space around them. A shot within firefox for example outputs a black image.

Greetings
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: problem with import

Post by anthony »

Then your X windows server is not prodiving the information requested for some reason. Probably due to the way GTK is handling its graphics.

Are you use some special graphics hardware. NVidia? ATI?

An alternative may be to create a 'nested' or virtual X window display, and grab from that. This would not depend on the hardware as they use a simpler special x windows driver for the virtualization process.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
porrier

Re: problem with import

Post by porrier »

anthony wrote:Then your X windows server is not prodiving the information requested for some reason. Probably due to the way GTK is handling its graphics.

Are you use some special graphics hardware. NVidia? ATI?

An alternative may be to create a 'nested' or virtual X window display, and grab from that. This would not depend on the hardware as they use a simpler special x windows driver for the virtualization process.
Two weeks ago I built in a ZOTAC GeForce 6200 A (NVIDIA GeForce 6200 GPU and 512 MB).
Probably since this time I have this problem. Before I used a ATI card with 128 MB.

But ok, I can live with that. If I get the time I put the old ATI card in again I make a testshot.

Thank you for your patience and help!

Greetings
Post Reply