CDR Tickets

Issue Number 4565
Summary [Media] Modify Media Caption and Content Report to include images
Created 2019-01-11 10:17:12
Issue Type Improvement
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Englisch, Volker (NIH/NCI) [C]
Status Closed
Resolved 2019-07-15 18:05:57
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.238558
Description

We want to be able to see the respective images while using the Media Caption and Content report. Please modify the report and the report interface to include an optional feature of having the image included in a new column.

Comment entered 2019-01-16 11:40:38 by Englisch, Volker (NIH/NCI) [C]

I have a couple comments regarding this request:

  1. This is an Excel report. I do not know at this point if it's possible to include images within the cells of a spreadsheet.

  2. The change request is release dependent and should be moved to Joule.

Comment entered 2019-04-08 11:29:47 by Englisch, Volker (NIH/NCI) [C]

, are we talking about adding a link to the images or including the actual image in an Excel cell?

If we're talking about the actual image - and if the Python software allows us to achieve this - there would still be a bunch of questions regarding the size of the image to be displayed (full size, thumb nail, etc.).

Comment entered 2019-04-08 12:46:38 by Osei-Poku, William (NIH/NCI) [C]

The preference is for adding the image to the spreadsheet instead of a link. I think a thumbnail would do. Also, if we get the ability to resize the image in the spreadsheet, that would be helpful. If that is not possible, please let me know what we should expect and that might just be good enough.

Comment entered 2019-04-08 13:40:32 by Englisch, Volker (NIH/NCI) [C]

If you want the ability to resize a thumbnail you will still need the picture to be available using higher resolution which may make the spreadsheet as a whole pretty large depending on how many images are included.  Don't try to send those document in an email. 🙂

So far, I have not been able to identify if it's possible to resize an image in such a way that the cell size adjusts with the image size.

As I mentioned before, we will have to identify if Excel allows us to present the images in a way you're expecting and then we'll have to identify if the Python library supports this.  There is a bunch of preliminary testing that goes along with this ticket and I will have to enter the story point estimate accordingly.

Comment entered 2019-04-11 16:38:03 by Englisch, Volker (NIH/NCI) [C]

I've been able to write a test program which allows me to add images to a spreadsheet, so we should be able to make the requested changes.

Comment entered 2019-07-12 18:21:24 by Englisch, Volker (NIH/NCI) [C]

This report is almost finished, but I need some input from you .

The problem I'm having is to determine the "right" size for the images within the Image column.  Images are not place "inside" of a cell but they are anchored to a cell.  This is because images are more often than not larger than a row in Excel and you want to display the entire image.  One option is now to specify the height of a column according to the image height - this will display the image as a regular thumbnail picture but it may hide portions of the text in the other rows. Another option is not to specify the row height.  This will display all of the text in the content and caption fields but this would "stretch" the image to the height of that automatically set row height.

The first option looks better but likely requires adjusting row heights manually by the users. 

We also want to decide the size of the image inside of the Image column.

Please have a look at the report on DEV but keep in mind that the entire portion to create the Excel report has been rewritten, so you do want to ensure everything else still looks as expected.

Comment entered 2019-07-15 07:20:20 by Osei-Poku, William (NIH/NCI) [C]


Please have a look at the report on DEV but keep in mind that the entire portion to create the Excel report has been rewritten, so you do want to ensure everything else still looks as expected. 

I am getting a python script error message:

 

<type 'exceptions.NameError'>

Python 2.7.13: D:\Python\python.exe
Mon Jul 15 07:17:00 2019

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 D:\Inetpub\wwwroot\cgi-bin\cdr\MediaCaptionContent.py in **()

{color:#909090}{{    469                 image = get_image(doc.id, height=200, width=200, return_stream=True)}}

{color}|

{color:#909090}{{    470             except Exception as e:}}

{color}|

=>  471                 bail

{color:#909090}{{    472                 args = doc.cdr_id, doc.has_blob, e}}

{color}|

{color:#909090}{{    473                 sys.stderr.write("{} ({}) failed: {}\n".format(*args))}}

{color}|

bail undefined

<type 'exceptions.NameError'>: name 'bail' is not defined 
{{      }}args = ("name 'bail' is not defined",) 
{{      }}message = "name 'bail' is not defined"

D:\cdr\Log\tmpbfvt7r.html contains the description of this error.

 


The first option looks better but likely requires adjusting row heights manually by the users. 

I agree. Let's proceed with the first option, with the knowledge that there is the possibility of manually adjusting columns to see al text. I don't see this as a big problem since the current option to run the report to see all the text remains.

Comment entered 2019-07-15 11:05:42 by Englisch, Volker (NIH/NCI) [C]

Could you please let me know what options you are changing/choosing?  I'm not able to reproduce the error at the moment.

Comment entered 2019-07-15 14:24:08 by Osei-Poku, William (NIH/NCI) [C]

The criteria are below. I think the problem happens when you select a date range from around March of 2017. Otherwise, it appears to work fine without any problems.

Comment entered 2019-07-15 18:04:59 by Englisch, Volker (NIH/NCI) [C]

Good catch, !

The report failed when a media document was picked up that did not link to an image file.  This has been fixed now and is on DEV.

Comment entered 2019-07-15 18:53:02 by Osei-Poku, William (NIH/NCI) [C]

The report looks good on DEV. We'll do more testing and let you know if we find any problems. Thanks!

Comment entered 2019-07-29 17:08:16 by Englisch, Volker (NIH/NCI) [C]

, can I assume that you didn't run into any additional problems with the report and I can merge these changes into the Joule branch?

Comment entered 2019-07-29 19:18:19 by Osei-Poku, William (NIH/NCI) [C]

Yes. Further tests did not reveal any problems.

Verified on DEV. Thanks!

Comment entered 2019-07-30 14:31:12 by Englisch, Volker (NIH/NCI) [C]

The changes have been merged into our release branch Joule.

Comment entered 2019-08-05 15:18:46 by Osei-Poku, William (NIH/NCI) [C]

Verified on QA. Thanks!

Comment entered 2019-09-09 09:32:28 by Osei-Poku, William (NIH/NCI) [C]

Verifid on PROD. Thanks!

Attachments
File Name Posted User
Caption and conent report.png 2019-07-15 14:19:38 Osei-Poku, William (NIH/NCI) [C]
CaptionandContent.JPG 2019-07-15 14:23:50 Osei-Poku, William (NIH/NCI) [C]

Elapsed: 0:00:00.001429