Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata tag filter filename too long errors #252

Open
dale-wahl opened this issue Apr 12, 2022 · 0 comments
Open

Metadata tag filter filename too long errors #252

dale-wahl opened this issue Apr 12, 2022 · 0 comments

Comments

@dale-wahl
Copy link

This is an odd one I ran into. I'm using hashtags for the category filters and ran into an issue with too long hashtags. PixPlot seems to be creating a json file for every tag that contains a list of related images. Using the tag itself for the filename seems to create some problems. A first look, I thought I could just hash the tag at the linked line or something similar to control the length, but I realized that the filter would not be able to find the file. The filter uses the tag that is selected to create the filename that it opens. I could change the tag to a hash in both places (i.e., the filter.json file and the filename), but of course then the front end would display a hash instead of the tag. Around we go.

One "easy" solution would be to modify the filter.json so that it contains a list of tags plus reference filenames. That way the frontend could display the tag, but, upon selection, it would open an associated filename. Then the filename could be controlled and standardized. I put "easy" in quotes because my frontend/javascript skills are not good enough to read in the modified json file correctly.

Here is an example of one of the errors I have seen.

Traceback (most recent call last):
File "/usr/src/app/pixplot/pixplot.py", line 1334, in <module>
    parse()\n  File "/usr/src/app/pixplot/pixplot.py", line 1331, in parse
    process_images(**config)\n  File "/usr/src/app/pixplot/pixplot.py", line 147, in process_images
    kwargs[\'image_paths\'], kwargs[\'metadata\'] = filter_images(**kwargs)
  File "/usr/src/app/pixplot/pixplot.py", line 248, in filter_images
    write_metadata(**kwargs)\n  File "/usr/src/app/pixplot/pixplot.py", line 356, in write_metadata
    write_json(os.path.join(out_dir, \'options\', i + \'.json\'), d[i], **kwargs)
  File "/usr/src/app/pixplot/pixplot.py", line 1147, in write_json
    with open(path, \'w\') as out:\nOSError: [Errno 36] File name too long: \'/usr/src/app/data/plots/2022-04-10-215744-Query-fd6da2de0e98a7319d21ba3f1a7a110e/data/metadata/options/:black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart::black_heart:.json

Obviously that's a pretty crap tag, but I didn't make it. Or choose the dataset. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant