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
Clipping and Exporting Bug
Re: Clipping and Exporting Bug
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".)
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".)
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Clipping and Exporting Bug
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.
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
-
- Exported only the clipped image as selection
- clip_export_selection.png (1004 Bytes) Viewed 8585 times
-
- clip_export_test.svg
- SVG with clipped image from 0.0 width rectangle
- (209.45 KiB) Downloaded 320 times
Re: Clipping and Exporting Bug
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.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.
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... !?
Re: Clipping and Exporting Bug
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?
Re: Clipping and Exporting Bug
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)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Clipping and Exporting Bug
Yes and windows 10. I recently updated my windows and my inkscape and that is when the problems started.
Re: Clipping and Exporting Bug
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?
Re: Clipping and Exporting Bug
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?
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)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Clipping and Exporting Bug
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.
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.
Re: Clipping and Exporting Bug
(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.
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)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)