Skip to content

Suggestion: Batch file processing as well as recursive directory scan #113

@TungstenX

Description

@TungstenX

This might be more involved than it sounds, but it would be handy to create thumbnails for all stl files in a directory. As well as an option to traverse directories to find stl to process. I wrote a simple bash script to do this for me (it is very verbose, not error handling, etc):

traverse() {
  for entry in "$1"/*
  do
    if [ -d "$entry" ]; then
      echo "$entry is a directory, stepping in"
      traverse "$entry"
    else
      extension="${entry##*.}"
      filename="${entry%.*}"
      echo "$entry is a file, file name is $filename and extension is $extension"
      if [ "${extension,,}" = "stl" ]; then
        echo "Making thumbnail"
        stl-thumb "$entry" "$filename.png"
      fi 
    fi
  done
}
traverse "$1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions