forums.tropy.org

Using Tropy to organize drawings (svg, ai, etc.)

Tropy looks absolutely fantastic for organizing several thousand digital drawings for my design work and my writing. I do have three questions that I have not been able to answer by searching. Please let me know if I should change any of them to feature requests.

  1. How can I (in code if necessary) change the background color to white rather than black? Many of my 1000+ svg drawings are transparent and thus the black text and lines completely disappear from view. This is crucial for me to use Tropy because those drawings appear as black rectangles in Tropy.
  2. Is there an existing way to bring in Illustrator .ai files? I could convert them online to svg if necessary, but I have about 4600 .ai files that would require conversion.
  3. Is there a easy way to extract which files did not import from the log file? Of the 1,371 I imported about 300 had some type of error message. I would like to know which files did not import.

Thanks in advance! Tropy looks ideal for many of us who are STEM rather than humanities. Thanks for the great work.

Which background are you trying to change, precisely? I’m assuming you mean the background of the image viewer and also the background of the thumbnails in the item/photo grids, but I think those are not black (in neither the light nor dark theme). In any case, you can override the UI styles as explained in this thread here, but could you post a screenshot of the legibility issue? Though transparencies are often difficult to solve in general, we would like to make most images work with the default themes.

There’s currently no way to import Illustrator files directly. If there’s demand for this we can certainly take a look at the format, but Tropy is currently not well suited for vector graphics: when you import SVG or PDF, the images are rasterized at a given resolution and then used. That’s because the image viewer and all effects are currently implemented for bitmap formats. Therefore, importing Illustrator files, if there’s a sensible pathway to rasterize them, is certainly an option. But going forward, it might be more interesting to have an alternate viewer built-in for vector graphics.

If you still have the log file, we can probably compile a list of all the files that failed to import (Tropy creates a new log file when you start it, keeping one copy of the previous log file). Otherwise, if you can compile a directory listing you could compare it to a list of the photos in your project file.

A quick way to get a list of all photo files in your project is to use SQLite, for instance:

$ sqlite3 project.tpy "select distinct path from photos order by path"

Thanks for the encouraging words!

@Martha would you mind to share one of those SVG files that render as black rectangles with us?

Thanks for the quick and excellent responses! I will study the details and post back again, hopefully later today.

I have to head out soon to a meeting and all day tomorrow is probably full. I am not sure of what names to call the Tropy views yet, but I recently realized the view where I type in notes is fine. It is only the images in the central section (thumbnails) and the single-item image on the right that have the black backgrounds.

I do not mind that the images are flattened. My use cases are for viewing and organizing, so I do not need the vector graphics (but that would be nice!). I have not seen some of my drawings in a decade or more, and it is great to get them all viewable in one place! Part of that process is getting some still useful ones out of Illustrator and into Inkscape.

I had used Agent Ransack (great program!) to list all my .svg files and then imported that entire list of 1371 files into Tropy. That created the log file I mentioned.

I came back to Tropy about 5 min ago and deleted everything to play with importing a few files using a custom template. So I will have to recreate the problem log file and post it later.

Also, if it helps, I have 20+ years of UX/UI consulting experience, and if I can help in that way please feel free to ask for my user feedback (assuming I join the community as a Tropy user). So far I have been really pleased with Tropy, but I have stumbled here and there figuring it out even though I watched the documentation video from four years ago.

Regards, Martha (Lindeman)

@Martha we can reproduce the black SVGs, we are going to fix that.

In the meanwhile, you can copy the CSS files below into your User-Data Folder (Help > Show User-Data Folder). This will make your drawings show on the default thumbnail background color (feel free to adjust the color in the CSS files to white, if you prefer that).
style-light.css (70 Bytes)
style-dark.css (71 Bytes)

It’s Christmas Day and your files to fix the black background issue for SVGs were a great Christmas gift. I deeply appreciate your UI design that made it so easy to file the data folder and install the files. The more I use Tropy, the more I like it! Thanks!

The gray background was an excellent choice because its visible presence or absence immediately communicates whether an SVG is transparent or includes a white background object. That is very useful information. Again, thanks for your design.

I will take a few minutes tonight to play around with the importing issues, but it may be early next week before I have time to devote to focusing on them

I did identify some questions about dpi from your statement “when you import SVG or PDF, the images are rasterized at a given resolution and then used.” My original files range in dpi from 72 to 600 (or more).

What does the default input ppi do? Is it the “given resolution”? It is points rather than pixels?
Why do some thumbnails show the density attribute and some do not? How is that determined?
If Tropy only links to the files (which I think is what happens from what I read), do the original files stay the same dpi? Then where is the new “given resolution” file stored? Do you mean as the thumbnail or as the viewed image? This has become confusing for me.

Again, thanks for your help!

To be helpful, I will post what I discover as I play with Tropy’s import function here as the issues are all relevant to the issue of importing SVG (and .ai) files.

  1. I cannot find where Tropy can show me the path to a file’s folder. Maybe I am missing something that is there? Because I have duplicate copies of an image file used in different projects and publications, I really need to know which thumbnail was used in which project. That info is only stored in the file path.

OK, I just found the full path as a popup when I hover over the filename in the metadata. I need it to be visible as an attribute rather than having to hover to see it. I could not find a property for filepath—could that please be added? (I checked the vocabulary list in https://github.com/tropy/tropy/blob/master/res/vocab/exif.n3.)

How about I can right-click on the thumbnail and have go to the folder containing that file in the menu of options? My goal is to choose the best version of the image in Tropy, then find and copy that file into a new location that will contain all my ‘approved’ images for future use. (I need to always know the dpi of the image to assure it is what is required for a project.) I still would like to have the file path as an object property so that I can identify the project for an image at a glance.

All right! I just found that if I right-click on the image on the right of the grid list, the “show original photo” option does exactly what I want to find the original file. That’s great! (I could delete my issues after I solve them, but I am leaving them here for other users who are having the same difficulties.)

  1. I discovered Tropy pulls in the Inkscape artboard region rather than the image region when the image is larger than the artboard. Thus when I did not resize the artboard and it is smaller than the image, Tropy cropped the image at the boundaries of the artboard. In Inkscape the sizes of the image and the artboard are independent, and thus I can just select the image and use it (e.g., export to .png). regardless of the artboard size. So I have had no need to make sure I resize the artboard to the image.

  2. Can Tropy import tell me when an import file will be a duplicate of an existing file? Could it be a standard copy display that lets me skip that file or not and to do the same for all files in the import list? Could I turn off the duplicate notification completely if I do not want to know?

  3. How shall I send the input log file so that we can discuss it?

Regards, Martha

To find errors in an input log file:
A. Open the log file in Notepad++ (great program!) and save to another file.
B. Search for “Error” using “Find All in Current Document”
C. The bottom pane of the Notepad++ display gives a complete list of all error lines so that the user can identify the Path with filename and the type of error.

For my 1370+ files, there were 344 errors. There were only four types of errors for my SVG files

  1. image type not supported: undefined\n (more than 300 errors)

Solved—an OpenOffice folder of its svgs was accidentally in the artwork path.

  1. Input buffer has corrupt header: svgload_buffer: bad dimensions\n",“msg”:"failed to import

Solved – these were five webfont files that were in the artwork path.

  1. Processed image is too large for the WebP format",“msg”:“failed to create image variant”} (9 errors) The error message (e.g., “{“level”:40,“time”:1640486352203,“type”:“renderer”,“name”:“project”,“stack”:“Error: Processed image is too large for the WebP format”,“msg”:“failed to create image variant”}” does not provide the file name, and that is what I need.

  2. Input image exceeds pixel limit",“msg”:"failed to import (4 errors)

What can I be told about Errors #3 and #4 that will help me know how to get the SVG images into Tropy?

The more I use Tropy, the more I appreciate your work. So many things I look to do are there just waiting for me. Thanks!

A question about the screenshot below—Why are the grid picture and the thumbnail different? The more detailed picture is the actual image.

These two screenshots in the reply posts show an item in which all three views are different for the same item. Why are they different and are they related to settings I can change? (As a new user, I can only embed one screenshot per post.)

Is there a way to show only items that have no tags? I need to identify them so that I can tag them.

Solved. Assign “Untagged” tag to all files brought into Tropy. Remove that tag when the first real tag is assigned. Then the tag “Untagged” shows only the items that I have not yet assigned any tags.

Thanks, Martha

Tropy is being extremely useful, so thanks again for your great work!

I found a new issue while working on my imported SVG files.

  1. Tropy substitutes another font (looks like Arial) for fonts that it does not recognize. This has happened with more than one unusual font (from fontsquirrel.com) that I had downloaded and used. This wrecks the spacing of the text on the image. Here is an example.
    image

Can Tropy at least tell me when it is substituting fonts? If it printed a line including the file path in the log file, then I could easily identify and fix the issue for the individual files.

I changed the font in a file from Adobe’s Source Sans Pro to Arial and Tropy still will not import any text. It only imports the triangle with its points and lines. I uploaded the SVG and the PNG it produces. The SVG upload picture looks just like what I see in Tropy. Help will be deeply appreciated as this is beyond me. Thanks in advance.

Thomson-Planckconstant-rotating-triangle

What does the default input ppi do? Is it the “given resolution”? It is points rather than pixels?
Why do some thumbnails show the density attribute and some do not? How is that determined?
If Tropy only links to the files (which I think is what happens from what I read), do the original files stay the same dpi? Then where is the new “given resolution” file stored? Do you mean as the thumbnail or as the viewed image? This has become confusing for me.

The default density in Preferences > Settings specifies the default resolution any vector graphic (PDF, SVG) is going to use on import. It’s in pixels and is only relevant for vector formats (thus other formats do not have the density property).

Tropy does not touch the original files. The rasterized files needed by Tropy (for thumbnails and in the viewer) are stored in the cache folder (Help > Show Cache Folder).

As a rule of thumb start with a low density to save disk space (e.g. 72ppi) and increase it if more details are needed. The density property in the metadata pane allows you to change the density for individual images after the import, the setting in the preferences allows you to specify the density for future imports.

  1. I discovered Tropy pulls in the Inkscape artboard region rather than the image region when the image is larger than the artboard. Thus when I did not resize the artboard and it is smaller than the image, Tropy cropped the image at the boundaries of the artboard. In Inkscape the sizes of the image and the artboard are independent, and thus I can just select the image and use it (e.g., export to .png). regardless of the artboard size. So I have had no need to make sure I resize the artboard to the image.

To my knowledge the image library we are using does not provide any options to choose a different bounding box. For SVGs the viewBox (the Inkscape artboard) is considered to be the format of the artwork. This is a reasonable choice in case the overflow is expected to be clipped (a browser would display SVGs the same way). However, in your case I think you will have to adjust the artboard manually before you import the SVGs into Tropy.

  1. Can Tropy import tell me when an import file will be a duplicate of an existing file? Could it be a standard copy display that lets me skip that file or not and to do the same for all files in the import list? Could I turn off the duplicate notification completely if I do not want to know?

Tropy should actually show a dialog in case you try to import an image twice:

Screenshot 2021-12-29 at 09.45.31

  1. Processed image is too large for the WebP format",“msg”:“failed to create image variant”} (9 errors) The error message (e.g., “{“level”:40,“time”:1640486352203,“type”:“renderer”,“name”:“project”,“stack”:“Error: Processed image is too large for the WebP format”,“msg”:“failed to create image variant”}” does not provide the file name, and that is what I need.
  2. Input image exceeds pixel limit",“msg”:"failed to import (4 errors)

What can I be told about Errors #3 and #4 that will help me know how to get the SVG images into Tropy?

The WebP image format we are using internally has a maximum size of 16383 x 16383 pixels. Apparently the SVGs you are trying to import result in images larger than that.

There are two workarounds for the time being: a) set a lower density in the settings before import, b) split overly large images manually into multiple images in case you actually need that much detail in Tropy’s image viewer.

We might implement automatic image tiling or use a file format that supports tiling at some point.

A question about the screenshot below—Why are the grid picture and the thumbnail different? The more detailed picture is the actual image.

These two screenshots in the reply posts show an item in which all three views are different for the same item. Why are they different and are they related to settings I can change?

The thumbnails in the photo panel have a minimum width / height so they are always large enough to hold the warning button and the selection icon. Thus, when you use the slider to change their size, their aspect ratio changes in a way that ensures a minimum area for the mentioned elements.

In addition to tag colors the thumbnails in the item grid have to be large (wide) enough to attach the ‘stack’ graphic on the top (when the item has several photos), therefore thumbnails in the item grid have a fixed minimum aspect ratio.

The images ‘fill’ the available area by default. In case you prefer them to ‘fit’ into the thumbnail area please add the file below to your User Data folder (and restart Tropy). With the custom stylesheets you already have in place this will result in complete previews using the default gray for letterboxing.

style.css (41 Bytes)