Opened 17 years ago
Closed 17 years ago
#1876 closed defect (fixed)
Incorrect image path handling
Reported by: | memfis | Owned by: | Radek Bartoň |
---|---|---|---|
Priority: | normal | Component: | ScreenshotsPlugin |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
The plugin uses the original filename (including path information) of the uploaded image to store it in the screenshots directory. This causes a problem when uploading from Windows to Linux because the plugin does not seem to handle the path correctly when executing ImageMagick. The effect is that the original file is viewable but none of the resized images are. The filenames created (for the file C:\Windows\Web\Wallpaper\Dom.jpg
) are as follows:
/path/to/trac/screenshots# find . ./1 ./1/C:\WINDOWS\Web\Wallpaper\Dom_large.jpg ./1/\WINDOWS\Web\Wallpaper\Dom_medium.jpg ./1/\WINDOWS\Web\Wallpaper\Dom_small.jpg
And this is what the url http://path/to/trac/screenshots/1/medium
shows:
Not Found File /var/lib/trac/test/screenshots/1/C:\WINDOWS\Web\Wallpaper\Dom_medium.jpg not found
Installed components:
- Trac 0.10.3
- TracScreenshots 0.4
Attachments (0)
Change History (4)
comment:1 Changed 17 years ago by
Status: | new → assigned |
---|
comment:2 Changed 17 years ago by
From what I see nothing changed in the way filenames are handled. If I may ask, since every screenshot gets its own id and directory anyway, why not just ignore the filename entirely and just name files "large.jpg", "medium.jpg" and "small.jpg" or with their original name without the path? What purpose does it serve?
comment:3 Changed 17 years ago by
I've added to code that gets file from request stripping of path. So instead C:\WINDOWS\Web\Wallpaper\Dom_medium.jpg
plugin should get Dom_medium.jpg
. If this not work, please send me here part of debug log where is printed recieved file name.
It should behave like you described and on Linux it does but I can't test it with Windows. Dropping filename entirely isn't bad idea and I'll do it like this in the future.
comment:4 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Well, I don't know want changed on my server overnight, but it works now just as you described. Maybe it was some code caching issue that prevented the fix from running. Thanks for fixing this.
Please try changeset 2542, it should fix this.