Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

Bug: Attached images are mangled

PNG and JPG images (maybe other formats too) are mangled on upload. BMP works okay.

source file 32,703 vtp.png c:\temp\
destination 32,810 vtp.png {file system path}/pub/Test/AttachTest/
  33,120 vtp.png,v  

Test case

  • Create new topic, save
  • Attach a PNG image (the image attached to this topic is the same one I used on my system)
    • there is no error message from Twiki or Apache at this point.
    • The inline image on the page shows as a broken [x]
  • clicking on the attachment link at the end of the page (... /bin/viewfile/Test/AttachTest?rev=1.1&filename=vtp.png) also shows a broken image.
    • this error message now appears in the Apache log:
[Thu Nov 22 17:35:49 2001] [error] [client 199.247.173.75] File does not exist:
/www/rr/pub/TWiki/TWikiPreferences/$name
[Thu Nov 22 17:42:58 2001] viewfile: Scalar value @types[0] better written as $t
ypes[0] at /www/rr/bin/viewfile line 39.
  • if I manually copy and overwrite the image in pub/Test/AttachTest/ with the one from my local drive everything appears as it should and no further messages appear in the apache log.

  • image from my local filesystem:
    vtp.png

  • image from within twiki, after upload:
    vtp2.png

Environment

TWiki version: 2001Sept01
TWiki plugins: DefaultPlugin, TWikiDrawPlugin, InterwikiPlugin, TigerSkinPlugin
Server OS: NT4sp6, cygwin 1.3.3(0.46/3/2) 2001-09-12 23:54
Web server: Apache CAMP 1.3.20
Perl version: 5.6.1 for cygwin multi
Client OS: w2k
Web Browser: IE5.5sp2

-- MattWilkie - 22 Nov 2001

Fix record


Not sure what went wrong. Note the sligtly increased file size. Sounds like a \n to \r\n conversion problem (aka setup problem) on the NT server.

-- PeterThoeny - 23 Nov 2001

Why would it occur to PNG and JPG and not BMP?

How would I determine if \n->\r\n conversion is the problem? I used to have the WhyDoLinesComeOutDoubleSpaced when editing problem but that went away when I mounted the drive in binary mode.

update: Verified that it is an \n->\r\n problem. If I attach a DOS text file the lines become doublespaced.

So in Cygwin mounting the drive in binary mode solves the editing 2x-space problem but does not solve the attach 2x-space problem.

-- MattWilkie - 23 Nov 2001

Not sure where the bug comes into play, TWiki only does a copy of the temp file supplied by the CGI library. Copy is based on the File::Copy library. Could you try and upgrade the CGI library? Try also with a different client OS and browser.

The error log you mention has nothing to do with this, see NameNotFound.

-- PeterThoeny - 02 Dec 2001

cpan reported that File::Copy is up to date but CGI was not (was v2.752, is now v2.78). I upgraded CGI and have now successfully uploaded PNG images. Thank you.

However, I have now either discovered a new bug or something is misconfigured: I cannot attach a second file to a topic which already has an attachment.

[Tue Dec  4 12:47:00 2001] upload: Can't create file /www/rr/data/Test/TestTopic6.txt
[Tue Dec  4 12:47:00 2001] upload: print() on closed filehandle TWiki::Store::FILE at ../lib/TWiki/Store.pm line 1163.

I am researching this right now and will come back with more details later.

later: this is not (merely) an attach bug, the topic.txt file is getting set read only, at which point edits fail as well (same error message in the apache log).

At the same time I have been troubleshooting this mangling problem I have been working on CygwinAuthentication with ntsec as well as upgrading to TWiki20011201beta.zip. Some wires may well be crossed now. I will attempt to back out some of the changes to produce a proper bug report.

later still: the locking problem went away after applying the steps 1-3 described by Colas in RcsNonStrictLocking. So now I have problem free uploads and problem free editing. The only significant issue left now is AuthenticationProblem smile later yet: Basic Authentication is now working, but it's a kludge.

-- MattWilkie - 04 Dec 2001

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng vtp.png r3 r2 r1 manage 31.9 K 2001-11-23 - 02:02 MattWilkie image from local file system, before attachment
PNGpng vtp2.png r1 manage 32.0 K 2001-11-23 - 02:03 MattWilkie image from within twiki, after upload
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2004-09-28 - JoeCavanaugh
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.