Clipping and Exporting Bug

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
rtfanson

Clipping and Exporting Bug

Postby rtfanson » Wed Dec 22, 2010 10:23 am

Problem with Clipping and Exporting: Export turns out blank.

I had just spent a lot of time trying to figure out how to crop a jpg photo and export as a png. The resulting export always came up blank. I wasted a few hours before I finally figured it out and thought I'd share. It may be a bug or maybe it makes sense to someone other than me.

THE BUG: If you clip a photo with a rectangle whose stroke width is 0.00, the clip will appear to work fine but the EXPORT WILL BE BLANK. As soon as you give the rectangle some stroke thickness and clip again the export will be work fine.

Richard

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Clipping and Exporting Bug

Postby brynn » Wed Dec 22, 2010 6:46 pm

Hi Richard,
Thanks for starting the new topic.
I cannot reproduce your results, with Inkscape 0.48 on Windows 7, 64-bit.

What Inkscape version and operating system are you using?

The only thing I can think, is that somehow your exported image is outside the image border. Maybe others will have more insight?

But if no one else has solved it, by the time you're ready to reply again (and the image border is not the problem), would you please upload a sample SVG file, illustrating the problem? (Using the full editor, not quick reply, there is a tab below the Submit button, that says "Upload Attachment".)

rtfanson
Posts: 1
Joined: Thu Dec 23, 2010 3:02 am

Re: Clipping and Exporting Bug

Postby rtfanson » Thu Dec 23, 2010 3:35 am

Hi Brynn,

I am using Inkscape 0.48.0 (r9654) on a Vista 32-bit and I know someone has achieved the same results on a Windows 7 machine (32-bit?) and an older inkscape (not sure which one though).

I uploaded the .svg and the resulting .png bitmap of the selection.

The only thing I did was this:
- import a jpeg image (in this case one of the windows sample images
- make a rectangle and set the stroke width to zero
- position the rectangle on the image, select both and Clip->Set
- Export Bitmap, where I only exported the selection

And it seems a bit more finicky than I first mentioned. I did a bit more testing all with stroke width set to 0.00 and got the following results:
- Export Selection - PNG BLANK
- Export page where page is much bigger than clipped image - PNG WORKED
- Resize page to drawing and export page - PNG BLANK


P.S. The reason i was clipping with zero width is because I wanted an image with a specific pixel dimensions. If I clip with a rectangle with stroke thickness the resulting image is slightly smaller. I could always resize after but I thought the zero stroke would have been easier.
Attachments
clip_export_selection.png
Exported only the clipped image as selection
clip_export_selection.png (1004 Bytes) Viewed 8587 times
clip_export_test.svg
SVG with clipped image from 0.0 width rectangle
(209.45 KiB) Downloaded 321 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Clipping and Exporting Bug

Postby ~suv » Thu Dec 23, 2010 6:06 am

rtfanson wrote:P.S. The reason i was clipping with zero width is because I wanted an image with a specific pixel dimensions. If I clip with a rectangle with stroke thickness the resulting image is slightly smaller.
Use 'None' for the stroke (i.e. remove the stroke) and give the rectangle a fill color with reduced alpha transparency so you can position it better (choose what portion of the photo you want to be visible) - instead of setting its width to zero.

I'm not sure why it fails with "stroke-width:0" (reproduced with your drawing and a current development snapshot on Mac OS X 10.5.8) - as soon as I either remove all style information of the clip-path (via XML Editor) or clip the photo with a filled rectangle with no stroke ('None' in the style indicator in the lower left corner of the main window), export works as expected (for selection, drawing, page).

Somehow the exporter seems to decide that for a rectangle with no fill, and a black stroke with zero width, nothing's there to be exported... !?

GabiBoy
Posts: 4
Joined: Wed Mar 30, 2016 6:00 pm

Re: Clipping and Exporting Bug

Postby GabiBoy » Wed Mar 30, 2016 6:05 pm

I have the same problem, when I clip using the rectangle tool it comes out blank on my exported png. The same thing happened yesterday when I imported a photo collection that I had previously made and then tried to export it again as a pdf (not using the clipping tool). Has anyone else had problems like this?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Clipping and Exporting Bug

Postby Moini » Thu Mar 31, 2016 1:35 am

Which Inkscape version are you using, GabiBoy? The latest 0.91?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

GabiBoy
Posts: 4
Joined: Wed Mar 30, 2016 6:00 pm

Re: Clipping and Exporting Bug

Postby GabiBoy » Thu Mar 31, 2016 2:52 pm

Yes and windows 10. I recently updated my windows and my inkscape and that is when the problems started.

GabiBoy
Posts: 4
Joined: Wed Mar 30, 2016 6:00 pm

Re: Clipping and Exporting Bug

Postby GabiBoy » Thu Mar 31, 2016 4:22 pm

I downloaded Inkscape 0.91 to my husbands Macbook and clipping etc all works perfectly when I save it as png and pdf. So is the problem with the compatibility between o.91 and windows 10 on my pc? is this a bug or something I can fix?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Clipping and Exporting Bug

Postby Moini » Thu Mar 31, 2016 8:29 pm

Have you been using the same file on both machines?
Could you upload the file (with a really detailed description of what you do and what happens) so we can test?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

GabiBoy
Posts: 4
Joined: Wed Mar 30, 2016 6:00 pm

Re: Clipping and Exporting Bug

Postby GabiBoy » Fri Apr 01, 2016 5:11 am

The file is too large to attach, any idea how to make it smaller so that I can attach the svg?
What i have done is imported a photo, used the stroke of a rectangle, selected both and then clicked on OBJECT - CLIP - SET. in the svg file it then looks exactly as I want it to look. I save it as a png and then when I open the png the image is not there.
If I open a new file and then import that original file into the new file then all the elements show up on the new png. But i would like to know why the original file does that as it happens quite often.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Clipping and Exporting Bug

Postby Moini » Fri Apr 01, 2016 6:56 am

(you can use a file hosting service, like google drive, dropbox or the French framadrop.org for uploading)

Just an idea: Is your image inside the page area? Are you exporting the correct area?

For the export dialog (File -> Export PNG Image) make sure that you choose all the correct settings so your image is inside the export area. Easiest way to do this is to select all objects you want to export and then use the 'Selection' tab of the export dialog.

Never use 'Save as...' and then 'Cairo png', this will give you a different kind of PNG which you most probably do not want.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Discuss Software Issues”