2751: Images with file names longer than 72 characters can not be properly uploaded as screenshots

matthew********@ni.*** (Google Code) (Is this you? Claim this profile.)
Feb. 15, 2014
What version are you running?

1.6.12

What's the URL of the page containing the problem?


What steps will reproduce the problem?
1. Create an image with a file name that is 72 characters long (including the extension)
2. Upload this file as a screenshot to review board
3. Publish this change

What is the expected output? What do you see instead?
Normally, a thumbnail of the screenshot shows up.  Clicking the thumbnail opens a page with the full screenshot. Instead, the thumbnail is blank and the image on the next page is completely empty. See the attached files.

What operating system are you using? What browser?
Win7 64-bit
Chrome 22.0.1229.79

Please provide any additional information below.

It looks like the screenshot is stored like this: 

image = models.ImageField(_("image"),
                              upload_to=os.path.join('uploaded', 'images',
                                                     '%Y', '%m', '%d'))

The django ImageField has a default max_length of 100, so when you take out the "uploaded/images/2012/09/28/" that leaves about 72 characters. Which is the length of the 68 character file name, plus the four character extension.


At the very least, users should be informed that an error has occurred and no broken screenshots should be added. This error message could tell them how they can avoid the problem (shortening the length of the file name).

Beyond that, it'd be great if this max_length could be increased.
chipx86
#1 chipx86
That's a long filename,  but we should be able to fix this.

This would apply to file attachments as well.
  • +Confirmed
  • -Priority-Medium
    +Priority-High
    +Milestone-Release1.6.x
    +EasyFix
#2 sampso******@gmai***** (Google Code) (Is this you? Claim this profile.)
Investigating
#3 sampso******@gmai***** (Google Code) (Is this you? Claim this profile.)
- Investigated by yangtina and slchen on both bleeding edge and release-1.6.12
- Unable to reproduce
#4 sampso******@gmai***** (Google Code) (Is this you? Claim this profile.)
- To address concern with databases other than SQLite
- yangtina will proceed with this issue
david
#5 david
  • +Component-Screenshots
#6 raja****@gmai***** (Google Code) (Is this you? Claim this profile.)
Can this be increased to varchar(255), overriding the default limit of 100. We would need a migration script as well. I can take this up if 255 seems a reasonable limit.
#7 oles****@gmai***** (Google Code) (Is this you? Claim this profile.)
Working on this.
david
#8 david
  • -Milestone-Release1.6.x
    -Component-Screenshots
    +Component-Attachments
david
#9 david
This is obsolete. The file attachments backend uses a much longer path length than the old screenshots backend.
  • -Confirmed
    +Fixed