Commit 338e9593 authored by irving's avatar irving

cambiado tamaño de imagenes en pdf

parent d5f0769c
......@@ -183,7 +183,7 @@
</a>
</li>
<li>
<a class="treeview submenu" href="{% url 'PDF' purchaseID %}" target="_blank" download="{{ searchInfo.title }} ({{ searchInfo.purchase_date }}).pdf">
<a class="treeview submenu" href="{% url 'PDF' purchaseID %}" target="_blank" download="{{ searchInfo.pdf_name }}).pdf">
<i class="fa fa-file-pdf-o"></i>
<span>Export to PDF</span>
<span class="pull-right-container">
......
......@@ -68,7 +68,8 @@ def report_L2ASCL(request, purchase_id):
image_path = email + "/" + purchase_id + "/" + "out/" + reporteDir + "/TCI/thumbnails/"
SCL_path = email + "/" + purchase_id + "/" + "out/" + reporteDir + "/SCL/"
pdfName = purchase['name'].replace(",", "").replace(" ", "_")+"_"+purchase['aggreg_date'].strftime('%Y-%m-%d-%H:%M:%S')+".pdf"
#print(pdfName)
searchInfo = {
"title": purchase['name'],
......@@ -82,7 +83,8 @@ def report_L2ASCL(request, purchase_id):
"productLevel": dataProduct['productLevel'],
"polygon": dataProduct['wkt'],
"description": purchase['description'],
"report_name": "SCL Image Classification Data(Km²)"
"report_name": "SCL Image Classification Data(Km²)",
"pdf_name": pdfName
}
......@@ -213,7 +215,8 @@ def Reports(request):
Data = True
pdfName = producto['name'].replace(",", "").replace(" ", "_")+"_"+producto['aggreg_date'].strftime('%Y-%m-%d-%H:%M:%S')+".pdf"
print(pdfName)
#print(pdfName)
productList.append({
"search_name": producto['name'],
......@@ -427,7 +430,7 @@ def myTable(path1, path2, basefile):
if image1.imageWidth < image1.imageHeight:
image2 = Image(path1, height=300, width=200, mask='auto')
else:
image2 = Image(path1, height=150, width=400, mask='auto')
image2 = Image(path1, height=150, width=200, mask='auto')
path, dirs, files = next(os.walk(path2))
for file in files:
......@@ -437,7 +440,7 @@ def myTable(path1, path2, basefile):
if image1.imageWidth < image1.imageHeight:
image3 = Image(mergeimages(path2, file), height=300, width=200, mask='auto')
else:
image3 = Image(mergeimages(path2, file), height=150, width=400, mask='auto')
image3 = Image(mergeimages(path2, file), height=150, width=200, mask='auto')
if image1.imageWidth < image1.imageHeight:
data = [['TCI', 'SCL'], [image2, image3]]
......@@ -656,6 +659,9 @@ def PDFGenerator(request,purchase_id):
story.append(Spacer(1, .3 * inch))
print(path1)
print(SCL)
print(file)
# table with images
story.append(myTable(path1, SCL, file))
story.append(Spacer(1, .2 * inch))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment