Modify

Opened 3 years ago

Closed 3 years ago

#9683 closed defect (fixed)

Images are empty on Windows (linux works fine)

Reported by: anonymous Owned by: seccanj
Priority: normal Component: ScreenshotPastePlugin
Severity: normal Keywords:
Cc: rjollos Trac Release: 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.

Attachments (5)

error.png (8.2 KB) - added by anonymous 3 years ago.
tmp_screen1326211056490000.jpg (870 bytes) - added by anonymous 3 years ago.
screen1326211056490000.jpg (6 bytes) - added by anonymous 3 years ago.
trac.log (5.9 KB) - added by anonymous 3 years ago.
api.py (4.2 KB) - added by seccanj 3 years ago.
Patched api.py

Download all attachments as: .zip

Change History (27)

Changed 3 years ago by anonymous

comment:1 Changed 3 years ago by anonymous

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

comment:2 Changed 3 years ago by seccanj

Hi, please, could you describe your environment:

  • 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

comment:3 Changed 3 years ago by seccanj

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

comment:4 Changed 3 years ago 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.

Changed 3 years ago by anonymous

Changed 3 years ago by anonymous

Changed 3 years ago by anonymous

comment:5 Changed 3 years ago 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.

comment:6 Changed 3 years ago 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

comment:7 Changed 3 years ago by seccanj

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

comment:8 Changed 3 years ago by rjollos

  • Cc rjollos added; anonymous removed

comment:9 Changed 3 years ago 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.

comment:10 Changed 3 years ago 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.

comment:11 Changed 3 years ago 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.

comment:12 Changed 3 years ago by anonymous

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

comment:13 Changed 3 years ago 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

comment:14 follow-up: Changed 3 years ago by anonymous

Any news?

comment:15 in reply to: ↑ 14 Changed 3 years ago by rjollos

Replying to anonymous:

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 ;)

comment:16 Changed 3 years ago 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

comment:17 Changed 3 years ago by seccanj

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

comment:18 Changed 3 years ago 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

Changed 3 years ago by seccanj

Patched api.py

comment:19 Changed 3 years ago by unclepaul84@…

Any progress on getting the new version out?

comment:20 Changed 3 years ago by seccanj

I am waiting for your testing the patch.

comment:21 Changed 3 years ago by unclepaul84@…

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

comment:22 Changed 3 years ago by seccanj

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed and released with 0.1.1.

Add Comment

Modify Ticket

Action
as closed The owner will remain seccanj.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.