#51 Enhanced image patch for v0.4.5

Unstable_(example)
closed
nobody
None
5
2014-05-29
2010-04-15
Simon Guest
No

This paste image patch is based on Victor Saase\'s insert image patch,
with grateful thanks to Victor for making a good start.

This patch is to be applied to a vanilla xournal-0.4.5.

This patch therefore contains Victor\'s changes, and also:

+ images are now stored in the journal file, inline in the XML, as
base64 encoded PNGs.
+ images can be pasted in from the clipboard
+ copy and paste of images works within the application
+ export of image with PDF now works

I also fixed this bug:

+ free pixbufs using g_object_unref not g_free.

Discussion

1 2 > >> (Page 1 of 2)
  • Simon Guest
    Simon Guest
    2010-04-16

    OK, there's 2 things I'm aware of that need fixing.

    1. There's a memory leak, as I don't free up the image_png. Will be fixed in rev2. (It's not too bad for now.)

    2. When you paste an image from the clipboard, I'm not very happy about where it appears, but I'm not sure how to fix this for now.

    Any more, please let me know.

     
  • Just a comment: In trying to review the patch i find it hard to see the real new code additions you made because you created new files and because of that a lot of code that already belonged to the Xournal codebase appears as new.

    Thanks a lot for the work. I had already been doing some part myself and had already implemented the image item handling inside Xournal's target, but you made much more.

    Good Job

     
  • Simon Guest
    Simon Guest
    2010-05-14

    Revision 2 fixes the memory leak, and also the image is now pasted in the correct position, at the pointer.

     
  • Simon Guest
    Simon Guest
    2010-05-22

    Revision 3 allows for pasting an image on a not-current page (in continuous mode). Note: any of these revisions will patch a vanilla xournal-0.4.5, so you only need the latest one.

     
  • loftyhauser
    loftyhauser
    2010-05-22

    Thanks for the work -- this is the capability I've been waiting for. Unfortunately, I can't export notes with embedded images to pdf -- I get the message "Error creating file <filename>". I'm using Fedora 12. Any ideas on how to fix?

     
  • philip_rhoades
    philip_rhoades
    2010-05-22

    I have the same problem as the previous version:

    I can copy a signature in GIMP and paste it into the Xournal page but the pasted copy is now black on grey instead of black on white . . is there something I am missing?

    Thanks for the work! - I am hanging out for this feature working!

    Regards,

    Phil.

     
  • Hi Lofty,
    If you can attach the Xournal file that fails to export, I'll see if I can determine the problem. It works for me here just fine, but I guess that doesn't help you.
    cheers,
    Simon

     
  • Simon Guest
    Simon Guest
    2010-05-23

    Hi Philip,
    Can you save your GIMP file to PNG, then insert into Xournal, and see what happens. If you get the same behaviour, send me both the PNG file and the Xournal file, and I'll see if I can see what's up.
    cheers,
    Simon

    PS: Last comment to Lofty was from me too, but I forgot to login first.

     
  • loftyhauser
    loftyhauser
    2010-05-23

    How do I attach a file to a comment??

     
  • Simon Guest
    Simon Guest
    2010-05-23

    I see making comments on this page is not the best way to conduct a bug hunt. Feel free to email me with supporting files at: tesujimath dot org with username simon dot guest, obviously put that together the other way round (which hopefully the email harvesting spammers can't do).
    cheers,
    Simon

     
  • Simon Guest
    Simon Guest
    2010-05-28

    Revision 4 fixed a stupid bug on AMD64, which stopped export to PDF from working.

    Revision 5 fixes the image position for insert image from file, and also adds support for transparency in images.

    I'm guessing previous lack of support for transparency caused your black on gray signature problem, Philip - please let me know if your problem is fixed by Revision 5.

     
  • loftyhauser
    loftyhauser
    2010-05-28

    Simon -- latest patch (rev 5) works great on Fedora 12 x86_64 (including pdf export). Thanks!

     


  • 2010-06-12

    How can I add images in their native resolution? With how my the patch works in my Xournal right now, the image appears in a size not the size of the original image, and attempts to resize only make the image blurrier. I would appreciate it if the patch caused inserted images to retain their original size, and then be resized as necessary, manually. Thank you.

     
  • Simon Guest
    Simon Guest
    2010-06-20

    Hi Sara,

    You are quite right, the blurriness is quite disappointing. I didn't know before how to address this, but I have looked into it, and have a solution. It gives images in native resolution as sharp as the original. Watch this space for an updated patch. (Not quite finished making the changes and testing.)

    cheers,
    Simon

     
  • Simon Guest
    Simon Guest
    2010-06-27

    Revision 6 is now available. Images are pasted at native resolution. Goodbye blurry images.

    cheers,
    Simon

     
  • Taka
    Taka
    2010-06-27

    Hi Simon,

    Thanks so much for providing us with this excellent patch :)

    I've tried rev6 today and it seems to be working great. Hopefully it gets integrated into cvs HEAD soon, as it gets harder to apply the changes correctly as time goes by.

     
  • Taka
    Taka
    2010-06-27

    Hi Simon,

    Now that I've used it extensively, some are some additional comments:

    * Possible bug: the "hand" tool seems to be unable to move images in holizontal direction.

    * Feature suggestion: It'd be nice to be able to duplicate previously inserted image as opposed to selecting the same image one by one by the file chooser interface.

    * Feature suggestion: It'd be nice to be able to insert an image with the clipboard content. For example, we might want to insert and image with the Control-v keybinding if the clipboard content is a full-path to an image that exists and is readable.

     
  • Simon Guest
    Simon Guest
    2010-06-27

    Hi Taka,

    Thanks for your comments.

    I think the hand tool is working OK. It doesn't move image or any other objects. It simply drags the whole page around. You can only drag sideways if you've zoomed in to see less than the full page width.

    For inserting the same image multiple times, it's only the insert from file function which needs to change. (For paste from clipboard, just bounce on ctrl-V.) Changing the file selection dialog to default to the previous file would be easy.

    For pasting a file by filename, this also sounds straightforward.

    Will add both of these to the to do list.

    cheers,
    Simon

     
  • Simon Guest
    Simon Guest
    2010-07-27

    Last patch, rev6, introduced a bug: printing does not include images. I have a fix, will post it soon, but for now, export first to PDF.

    cheers,
    Simon

     
  • Simon Guest
    Simon Guest
    2010-07-29

    Revision 7 fixes two bugs, and adds a minor feature. When you insert an image file, it remembers the filename used, and uses this as the subsequent default. The bugs fixed were introduced in revision 6:
    1. Printing did not include images.
    2. Loading a multi-page journal caused all the images to appear on page 1.
    These now both fixed.

    Please let me know of any other problems.

    cheers,
    Simon

     
  • Thanks for creating this patch. It adds a feature that I was missing in xournal ever since I started using. Thanks that really made my day!

     
  • Tom D
    Tom D
    2010-12-13

    This patch worked like a charm. Hopefully your work will get incorporated into the next xournal release. Thanks again for sharing this.

     
1 2 > >> (Page 1 of 2)