Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions endurance_line_shading.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self):
dest="active-tab",
help="The selected UI-tab when OK was pressed")

def drawfunction(self, image_w, image_h, file):
def drawfunction(self, image_w, image_h, file):
reader = png.Reader(file)
w, h, pixels, metadata = reader.read_flat()
matrice = [[1.0 for i in range(w)]for j in range(h)]
Expand Down Expand Up @@ -300,7 +300,7 @@ def draw_path(self, node, file):
t = 'translate('+ x +','+ y +')'
newpath.set('transform', t)
image_w = float(node.get('width'))
image_h = float(node.get('height'))
image_h = float(node.get('height'))
newpath.set('d', simplepath.formatPath(self.drawfunction(image_w, image_h, file)))
newpath.set('title', 'Line_Shading')
node.getparent().append(newpath)
Expand All @@ -320,7 +320,7 @@ def export_png(self, node, file):
w_png = str(round(poinnt_per_min_period*image_w*float(h_png)/max_period/image_h))
id = node.get('id')
cmd = ["inkscape", current_file, "--export-png", file, "-w", w_png, "-h", h_png, "--export-background", "rgb(255, 255, 255)", "--export-background-opacity", "255", "--export-id", id]
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
proc = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return_code = proc.wait()
#f = proc.stdout
#err = proc.stderr
Expand All @@ -332,7 +332,7 @@ def effect(self):
image_selected_flag = True
tmp_dir = tempfile.mkdtemp()
png_temp_file = os.path.join(tmp_dir, "LineShading.png")
self.export_png(node, png_temp_file)
self.export_png(node, png_temp_file)
self.draw_path(node, png_temp_file)
shutil.rmtree(tmp_dir)
if self.options.remove:
Expand Down