Ticket #9683 (closed defect: fixed)

Opened 1 year ago

Images are empty on Windows (linux works fine)

Reported by: Assigned to: anonymous seccanj normal ScreenshotPastePlugin normal rjollos 0.12

Description

I can paste images and see them in the little preview window. To send the screenshot is also no problem, but if i want to open it again, i see always an empty picture like the attached screenshot. I do not see any errors in my Trac logfile.

Change History

01/12/12 16:20:15 changed by anonymous

I use the downloaded egg file of the plugin (ScreenshotPaste?-0.1.0-py2.7.egg) together with Trac 0.12.2.

01/12/12 19:41:21 changed by seccanj

• Operating system
• Java version
• Apache or tracd?

Could you take a look inside your Trac environment directory: at the same level as "plugins" and "conf", etc. there should be a directory named "tmpscreenshots". What is there inside it? Also, there should be a directory "attachments" with subdirectories "Ticket" and "Wiki" (if you attached files to both types of objects). What is there inside them?

Let me know. Ciao, Roberto

01/12/12 21:08:43 changed by seccanj

Also, could you set debug on Trac, restart the server, reproduce the problem and attach the full trac.log ti this ticket?

01/16/12 08:29:27 changed by anonymous

Operating System: Windows XP Java Version: 1.6.0_29 Server: Windows Server 2003 with Apache

tmpscreenshots is there but it contains only the empty images (e.g. tmp_screen1326211056490000.jpg). The directory attachments is there also. Inside the ticket directory are png files (screen1326211056490000.jpg) all with the size 6 byte.

01/16/12 08:46:09 changed by anonymous

This warning: WARNING: HTTPInternalError: 500 Trac Error (No file uploaded) was produced by pressing "Add attachment" instead of "Send the Screenshot". It has nothing to do with the problem.

01/16/12 14:51:49 changed by seccanj

The log shows nothing wrong... Could you take a look at the Java log console available on the client machine, to see if there's anything wrong:

• Right-click the java tray icon (bottom-right corner on Win XP) and click "Java debug console" (or something like that)
• Copy and paste the contents of the log into a text file to be attached here

Ciao, Roberto

01/16/12 14:52:44 changed by seccanj

BTW, the java console is only available when the applet is displayed on the page.

01/16/12 19:26:17 changed by rjollos

• cc set to rjollos.

01/17/12 09:07:40 changed by anonymous

Hmm nothing to see:

wanted format:png:
supported format:BMP:
supported format:bmp:
supported format:jpg:
supported format:JPG:
supported format:wbmp:
supported format:jpeg:
supported format:png:
supported format:PNG:
supported format:JPEG:
supported format:WBMP:
supported format:GIF:
supported format:gif:
basic: Starting applet teardown
basic: Finished applet teardown


But can it be that something is wrong with the format of the images? I ask because the temp images in tmpscreenshots ends with .jpg but the content seems to be a PNG header and no JPG header.

01/17/12 10:20:19 changed by seccanj

• status changed from new to assigned.

I could reproduce it on windows (I only tested on linux and it everything works smooth).

You're right about the format, it is actually a png but it's sved with .jpg extension. Linux doesn't seem to bother, but windows does.

I patched the code to use .png extension, but with no luck either.

Patching the code to actually send JPG images gives better luck. The files in tmpscreenshots are almost correct images, but are anyway somewhat corrupted. The files in the attachments directory are anyway ridicolously small. So there's something wrong with the copy process too.

Still digging into the problem.

01/18/12 06:01:29 changed by rjollos

I'm going to be installing this plugin soon. Is the issue you guys are working on caused by the Windows client or the Windows server? I'm running CentOS server and Windows 7 and XP clients.

01/20/12 08:43:03 changed by anonymous

I do not know. I'm running Windows Server 2003 and Windows Clients (Win7 and WinXP).

01/20/12 17:48:47 changed by seccanj

I'll try to find out something during this w/e, including whether the problem is observed with only a Windows server or client.

Ciao, Roberto

Any news?

(in reply to: ↑ 14 ) 02/06/12 08:41:48 changed by rjollos

Any news?

I second that, but at the same time I've watched what excellent work seccanj has done with the TestManagerForTracPlugin, and realize he might be slightly busy ;)

02/06/12 11:41:25 changed by seccanj

Hi all, thanks for your patience... I couldn't find any more time to digg into this problem yet, my real job is very demanding these days :D

I think there's something wrong with the base64 encoding (browser's javascript engine)/decoding(python) process, and also something more wrong with the copy of the downloaded bits from the tmpscreenshots to the attachments directory.

I'll try to look at it asap... (anyone willing to contribute?)

Ciao, Roberto

02/06/12 11:41:41 changed by seccanj

• summary changed from images are empty to Images are empty on Windows (linux works fine).

02/07/12 16:35:09 changed by seccanj

Hi, I found and fixed the problem, caused by my poor Python skills ;-)

You can find in attachment the fixed api.py file, to be replaced into the source tree as: screenshotpaste.0.1.0/screenshotpaste/api.py

Do a build and replace the generated egg file into your Trac project "plugins" directory.

Please, let me know if this works for you. If so, I will ship a new release of the plugin asap.

Ciao, Roberto

Patched api.py

02/08/12 22:56:20 changed by unclepaul84@gmail.com

Any progress on getting the new version out?

02/09/12 12:09:10 changed by seccanj

I am waiting for your testing the patch.

02/09/12 14:51:02 changed by Unclepaul84@gmail.com

Your patch works ! Thanks for your work! Our qa team is loving this!

02/12/12 09:48:51 changed by seccanj

• status changed from assigned to closed.
• resolution set to fixed.

Fixed and released with 0.1.1.

Add/Change #9683 (Images are empty on Windows (linux works fine))

Change Properties