Skip to content

Commit

Permalink
Remove release stuff and use directory detection to invoke py files f…
Browse files Browse the repository at this point in the history
…rom sh files
  • Loading branch information
Olivier Brunel authored and Olivier Brunel committed May 2, 2020
1 parent f3f0910 commit a1135c8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 136 deletions.
Empty file removed .gitmodules
Empty file.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
-> **Clone with option --recurse-submodules to fetch submodules directly when cloning**

This little personal project helps frame photos into frames of mockup rooms (mockup rooms not provided except small sample).
You can use any mockup you want, portrait, square or landscape, and frame any photo you want to the right frames. The program will help you calibrate your mockups (to map where the frame is in the mockup room) and then assemble photos to them - it will automatically frame all landscape photos into landscape frame mockups, portraits into portrait frame mockups and square into square frame mockups.

Expand Down
76 changes: 0 additions & 76 deletions RELEASE.md

This file was deleted.

51 changes: 0 additions & 51 deletions create_release.sh

This file was deleted.

3 changes: 2 additions & 1 deletion frame.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

# Just a wrapper for python
python3 frame.py "$@"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
python3 "$DIR/frame.py" "$@"
11 changes: 6 additions & 5 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ def help(message = ""):
print("\n"+message)

def testMockup(mockuppath, framesize, framecoordinates, noask):
if getattr(sys, 'frozen', False):
application_path = os.path.dirname(os.path.abspath(sys.executable))
elif __file__:
application_path = os.path.dirname(os.path.abspath(__file__))
application_path = os.path.dirname(os.path.abspath(__file__))

testfilepath = os.path.join(application_path,"imageformockuptest.jpg")
print("Mockup file image for frame test: "+testfilepath)
Expand All @@ -38,7 +35,9 @@ def testMockup(mockuppath, framesize, framecoordinates, noask):
# Add photo to frame at coordinates
framed_im.paste(resizedphoto_im, framecoordinates)
# Save result in working dir
framed_im.save(os.path.join(os.getcwd(), 'isItFramedOk.jpg'))
testresultfilename = 'isItFramedOk.jpg'
wheretosaveresultfile = os.getcwd()
framed_im.save(os.path.join(wheretosaveresultfile, testresultfilename))

# Helper for frame name in case it's good
print("If this result is good (meaning you dimensioned the frame correctly and the photo fits perfectly in it), you should rename the frame as follows in order to use it as a frame for kshhhactivate:")
Expand All @@ -60,6 +59,8 @@ def testMockup(mockuppath, framesize, framecoordinates, noask):
os.rename(r''+mockuppath, r''+resultfile)
print("File renamed, now ready to use with kshhhactivate.py")

print("\nCheck file "+testresultfilename+" at "+wheretosaveresultfile)


def main(argv):
# Look for options
Expand Down
3 changes: 2 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

# Just a wrapper for python
python3 test.py "$@"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
python3 "$DIR/test.py" "$@"

0 comments on commit a1135c8

Please sign in to comment.