GithubHelp home page GithubHelp logo

isabella232 / swift-assetslegalmentionschecker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orange-opensource/swift-assetslegalmentionschecker

0.0 0.0 0.0 56 KB

Swift program which can crawl into folders and look if images contain legal mentions in their metadata

License: Other

Swift 100.00%

swift-assetslegalmentionschecker's Introduction

Swift-AssetsLegalMentionsChecker

Swift-written tool to use in command line to check if images contain copyright / legal mentions / credits in metadata. This project is built with Xcode.

Managed files

This current version deals only with PNG file (with .png or .PNG extensions), and looks for some fields in the metadata : TIFF, IPTC and PNG. If will check in these fields if the mention to look for is exactly the defined value.

Executables

If you are looking for the executables you can have a look on folder ~/Library/Developer/Xcode/DerivedData/Swift-AssetsLegalMentionsChecker-XXX/Build/Products/Debug/ where XXX is a kind of random string generated by Xcode. You have to build the project with Xcode before.

Run the program

Assuming EXECUTABLE is the executable file (you can pick for example in the mentioned folder above):

To get the usage of the program:

EXECUTABLE --help

To get the version of the program:

EXECUTABLE --version

To run the program where it have to find recursively a CREDIT line in metadata of images in the FOLDER:

EXECUTABLE --folder FOLDER --mention CREDIT

You can also make the program displays more messages with the verbose option:

EXECUTABLE --folder FOLDER --mention CREDIT --verbose

Exit codes

The program returns a value indicating if a problem occured or not:

  • (-1): something wrong occured (command line options for example)
  • (0): no error appeared, normal exit without image processing (e.g. display help)
  • (+1): normal exit but failure occured during check of images (i.e. at least 1 file does not have legal mention in credits)
  • (+2): normal exit, all files contain the legal mention

Xcode integration

You can use this tool with an Xcode build script. The following sample can be placed in a script to add to your Xcode configuration. Thus the tool (with binary in the project) can be used easily.

#!/bin/sh
LEGAL_NOTICE="My Project, (c) Copyright Me-MySelf-And-I- SA 2020, CC-BY-SA-NC 4.0"
TOOL_PATH="path/to/binary/of/this/tool"
TARGET="."

$TOOL_PATH --folder "$TARGET" --mention "$LEGAL_NOTICE"
result=$?

if [ $result -eq 2 ]
then
	echo "โœ… All assets contain legal notice in metadata."
	exit 0
else
	echo "๐Ÿ”ด Something wrong occured, see logs for further details."
	exit 1
fi

swift-assetslegalmentionschecker's People

Contributors

pylapp avatar

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.