Giter Club home page Giter Club logo

Comments (7)

FyorDev avatar FyorDev commented on July 3, 2024

Thanks for finding this, it will be fixed after adding support for local image links which I realized were missing in #2 , probably at the same time in over a week.
May be harder since image items and text items are mixed in standard files but files generated with this tool do all images first and all text after. I hope this parenting functionality just works with IDs and doesn't require a specific order in the file requiring a write() restructure.

from pureref-format.

FyorDev avatar FyorDev commented on July 3, 2024

Fixed in bfb842e
If you read and write a PureRef file, text items now stay parented to their parent image or parent text. You can create parented text from scratch by creating a PurGraphicsTextItem and putting it in either another PurGraphicsTextItem or a PurGraphicsImageItem which now share the same Item superclass. Be careful not to add children to text that is already a child since the software PureRef does not support recursive parenting (yet, probably never).

Thank you very much for pointing out this missing feature. I'd love to hear any suggestions, requests and complaints (maybe about purformat.py having become too big haha). And I'd love to see what you make with this tool (: you could tag or DM me on Twitter with @FyorDev.

The way text parenting works, is that some of the bytes at the end of a text/image transform indicates how many of the following text items should be parented to it, and these text children are not counted in the header.

from pureref-format.

Irmitya avatar Irmitya commented on July 3, 2024

Be careful not to add children to text that is already a child since the software PureRef does not support recursive parenting (yet, probably never).

It DOES do children of children, it's just a bypass/glitch is needed to get it to work.
What you first do is create a text, while selecting it: add a new text, creating the link. Next, you copy and paste them to something they're NOT linked to.
They will then keep their original attachment, whilst also linking to the new parent.

I was expecting the update to just detach the notes but Pureref offset at least one of my texts (still attached) but detached and sent the rest to the center.

Thank you very much for pointing out this missing feature. I'd love to hear any suggestions, requests and complaints (maybe about purformat.py having become too big haha). And I'd love to see what you make with this tool (: you could tag or DM me on Twitter with @FyorDev.

Suggestions, Requests and Complaints:

  • PurFile.read() does not seem to reset the items loaded, just append them, creating jumbled data. I assume this is to allow merging files but I don't know the results of such a file, and it's just an inconvenience for me, requiring a new PurFile() instance for every file.
  • The classes could have helper functions, to allow usage without needing to make new code for basic tasks.
    • For example: image.load()/image.save()
    • .add_note(text="Note")
    • arrange/align/normalize functions from pureref
    • re-arrange image order (I assume images )
  • set the pureref_gen_script.py to use input(), maybe with a notes printed as explanations, so that if someone runs it, they can specify where they want it to run
  • setup a __init__.py to place this in the modules folder
    • Merge the export scripts to one file and maybe move it away from purformat.py.
      It's not obvious that neither is needed and is just a usage example.
      pureref_gen_script.py can go in a if __name__ == "__main__":
  • Obvious: Have the formatter write so that pureref doesn't see them as corrupted.

I assume you meant for me to tell you this stuff here on github (or as a new issue), and then message you on twitter if ever I finished a script/tool using this access into .pur.

I don't mind messaging you, just all I'm doing inside pureref is updating numbers/links in notes attached to images (and adding new images), as per my usage of pureref.
The way I use pureref is I add an image, then add notes centered above/below it: if it's named (for example a tv series), the above contains the relevant titles for the series, and below contains url links, the episode number [seen / available-total], summary/description, watched date, etc.
If it's not named, for example a screenshot of a webpage, the I just attach the url above, and MAYBE a description somewhere.
(I also normalize their sizes relative to a certain image that I duplicated a few hundred times)

And so I can use python to log which series have been updated but with this, I don't have to manually update the numbers, I can have the updater also update the notes.

from pureref-format.

FyorDev avatar FyorDev commented on July 3, 2024

Thanks for the guide to create recursive children, I'll add that. I will try to replicate notes returning to center so I can fix that too. It's weird because even if transforms can be relative this shouldn't matter since it just copies whatever is in the original transform.

If I get to it, I'll keep helper functions that are likely needed in mind. I think I should pull apart purformat.py first. And I'll merge the gen scripts or hide one part in a subfolder. The problem is that there is a huge number of operations you may want to perform, if I make functions for every way you may want to manipulate the data I'll have made the entire backend for my own reference software. I'd rather supply the raw data which is now in an easy to use shape, so that you can make functions for the specific things you need, but I will think about it.

set the pureref_gen_script.py to use input(), maybe with a notes printed as explanations, so that if someone runs it, they can specify where they want it to run

You can give the script commandline arguments since b486b67, and I'd like to avoid having to press enter twice for defaults because that's the only thing I use.

  • Have the formatter write so that pureref doesn't see them as corrupted.

I looked into this when I finished reverse engineering all the contents, which I wasn't even sure I would do for text too since I only need it for images. But I gave up on figuring out the checksum, I don't know what algorithm they use with what parameters on which part of the file.
If I wanted non-corrupt files, I'd make a script that opens it in PureRef, waits for it to load and hits CTRL+S (:
But I decided to accept that this should be done by hand, the project already got this far and I wasn't sure everything that this tool can now do would even be possible at first.

I assume you meant for me to tell you this stuff here on github (or as a new issue), and then message you on twitter if ever I finished a script/tool using this access into .pur.

Yes, I appreciate it!

It's fun to hear how you use PureRef as a kind of database, it's such a versatile software.

from pureref-format.

FyorDev avatar FyorDev commented on July 3, 2024

I couldn't find the time for a while, but it's all fixed now.

Recursive children are supported, and they won't lose their transforms. All thanks to your description of the bypass that's needed.

from pureref-format.

Irmitya avatar Irmitya commented on July 3, 2024

Cool beans yo.

I assume 14c8230 is why the file also doesn't give any warnings on load either.
If that is the case, I'm curious as to what would happen without the child-fix.
Would pureref load the files with and just break the links with no warning?

I'm curious because from what I can see so far, it's a standard pur file but what if there was something else that get's lost from the files?
And if pureref would tell you if there was, then what if you could store things pureref can "use" but doesn't "do/save", like linking images to other images. I'm sure it could do this but just doesn't in order to retain images (as it's goal) unlike texts, and choose not to give the option to users.

from pureref-format.

FyorDev avatar FyorDev commented on July 3, 2024

I assume 14c8230 is why the file also doesn't give any warnings on load either.

Yes, it was quite a challenge but I figured out that they use md5 for the checksum on al bytes after 0x6C, I didn't think I would ever figure out how to fix this issue but I just gave it another try while I was working on the repo again.

Without the child fix the same would happen as before and it would just forget links, child text is the same as any other text except that the previous text item indicates the next N items are their children ( apparently recursively, so the next N that aren't already children of its children ). the checksum should have no effect on that.

There are probably many things you could get the software to do, maybe parented images is possible if PureRef expects a number of generic items as children instead of text specifically.
There are definitely a lot of things you could do with the cropping points, such as generate a circle or give an image round corners.

from pureref-format.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.