Rotating resources - Locale messes up X and Y

Bug #475073 reported by Jonathan Thomas
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
Fix Released
High
Unassigned

Bug Description

Hi there:

I have been playing with the rotation for a while but I don't understand why when I rotate a resource over the Y axis (no mather if it is a video or an image), the image moves to the top bottom of the screen. Also if I try to leave all the fields with zeros at rotation effect, still the video refuses to show up (seems to be at the top bottom too). The only way of leave things as the begining is removing the effect.

Am I doing something wrong?, because I see the demo video and it seems that this feature is working properly.

Tags: mlt

Related branches

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

I have confirmed that the "affine" filter seems to be causing the problem in MLT. For some reason, when you change your locale (from en_US to fr_FR) it offsets the Y of the rotation to the very bottom of the screen.

Any locale that uses a "comma" instead of a "period" seems to have this issue. I think this is a bug inside the "affine" filter, so I'm going to leave this bug report as a place-holder, until I have a change to debug it.

Revision history for this message
Jef Damen (jef-damen) wrote :

I can confirm this issue.
I am working with Ubuntu 9.10 (64bit) , Openshot ver. 0.9.54 and my locale is nl_NL.
All the values off the settings of those effects show up with a comma i.s.o. a period and with the rotation effect the picture is at the bottom.
For the rest Openshot is working great, thanks.

Revision history for this message
Jef Damen (jef-damen) wrote :

Sorry, my locale is not nl_NL as I mentioned above but nl_BE

Revision history for this message
Stefano Severi (stefano-sev) wrote :

I can confirm this issue.
I am working with Ubuntu 9.10 (32bit) , Openshot ver. 1.1.0 and my locale is it_IT.

tags: added: mlt
Revision history for this message
Olivier Girard (eolinwen) wrote :

This bug is always present for severals languages like the French, the Dutch, and some others. I'm on a Lucid Lynx in 64 bits and i use the 0.5.4 version of MLT.

Revision history for this message
Olivier Girard (eolinwen) wrote :

I think more athat

Revision history for this message
Olivier Girard (eolinwen) wrote :

Sorry for the error.
i think more and more that this problem and this one which touuch the lenght of the translation of some languages (that spanish, nederland, french, italian, chinese,...) comes of our utilisation of the characters in Python and Gettex too .
In U.S.A. and the countries anglo-saxon, you use the norm Ascii who uses 128 characters but the european language needs more characters and so they use the Unicode norm who have 256 characters. so i think that we use a bad method and to resolve it resolve it need to be quickly.
So i push this bug and severals others in this milestone

Changed in openshot:
milestone: none → 1.2.0
Revision history for this message
Olivier Girard (eolinwen) wrote :

There is a workaround in the forum : http://openshotusers.com/forum/viewtopic.php?f=25&t=473&p=2059&hilit=420#p2059
who prouve this

Revision history for this message
Olivier Girard (eolinwen) wrote :
Revision history for this message
Jonathan Thomas (jonoomph) wrote :

I did some more research on this issue, and it's very strange indeed. The XML file that OpenShot creates works perfectly using the command line "melt". The rotation works regardless of the locale. However, when OpenShot loads the same XML file using the Python API (and SWIG), the rotation is most off the screen. I still have no explanation for this.

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

Here is an email that I sent to Dan about this issue. I was able to get a reproducible example, and it seems related to the GTK library. I have attached my example.

----------------------------
Hi Dan!
I have a very strange bug related to the affine filter, locales that use commas for decimals, and the gtk library. This might sound bizarre, but I have a reproducible example for you.

The example is a simple logo.png file that is being rotated by the affine filter.

$ python play.py (This syntax works great, assuming your locale is not comma based)
$ LANG=es_ES python play.py (This syntax moves the center of the rotation off the screen, at the very bottom, with the corners rotating into view)

If, you open up the "play.py" file, and comment out the "import gtk" line, it will work correctly.

For example:
import mlt
import time
import sys
#import gtk

I have verified the example works correctly with "melt", and only seems related to importing the gtk library when using Python. Any thoughts on this strange issue? I'm sure it's something simple... at least I hope it's something simple. =) I will keep investigating the gtk library, and see if I am not setting some locale specific property. If you have any ideas, I would love to hear them.

Thanks as always!
-Jonathan

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

Dan replied to my email with the following suggestion:
Add the following line: locale.setlocale(locale.LC_NUMERIC, 'POSIX')

This fixes the rotation bug regardless of what locale is being used! So, thanks to Dan for the help.

Changed in openshot:
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Olivier Girard (eolinwen) wrote :

Oh yes, it is wonderful and it was an nasty bug because this effect is very popular and useful. I will test him when it will be in the trunk. So now we will pass at the next step i.e. provide a tool more easily to use that he is actually .See this bug ( https://bugs.launchpad.net/openshot/+bug/506192) but it will be for ...............;the next milestone.

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

The fix is already committed to the trunk. So, you can test it at any point. =)

Revision history for this message
Olivier Girard (eolinwen) wrote :

Already ? Okay and thanks. I'll done an update and i test it.

Revision history for this message
Olivier Girard (eolinwen) wrote :

Hum. I have a view shared. It works fine for the Axe X,Y,Z and i have now the picture in the middle of the preview(=<normal). But I'm wondering me if the others parameters (i.e.respectively Variable Fixed (X,Y,Z) and the two last) are really working or i don't know how they works. I will see better tomorrow. and i'll let you know. Thanks.

Revision history for this message
txapelgorri (ibon) wrote :

Thank you for fixing this bug :)

Cheers, Ibon.

Revision history for this message
Olivier Girard (eolinwen) wrote :

HI Jonathan,
i confirm that :
*for the Axe X,Y,Z that works.
*for the others parameters, nothing works. I have try to rotate a clip taken with my Nexus (so in a format NTSC 30 i/s) and i have just play with nothing visual results. After, i have try to calculate it for a rotation of 90° (the main utilisation) and i have matched my degrees by frame for my clip who have a length of 24.3243s exactly.
After i have put my equation who is :
degree_by_frame = 90° (what i want to rotate)/(30 (my fps)*24.3243(the length of my file taken in the clip Properties tab length))
I obtain 0.123333457 like result that i put in Variable X (for Y it is the same) I preview and nothing is happen.
So either that don't work either i do something wrong (i doubt a bit). How do you do for use this effect ?
NB: That's just taken only two digits after the decimal => is it a risk of problem i.e. white frame or something else if all is not rotate ?
Thanks

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

Olivier,
Please see my attachments for instructions on how I'm testing the rotation effect.

Thanks,
-Jonathan

Revision history for this message
Jonathan Thomas (jonoomph) wrote :
Revision history for this message
Jonathan Thomas (jonoomph) wrote :
Revision history for this message
Jonathan Thomas (jonoomph) wrote :
Revision history for this message
Olivier Girard (eolinwen) wrote :

Jonathan,
 After severals tests, all is working now for this effect.
Your parameters are good and i am sure now that works that for the next milestone this tool could win in simplicity.
See the screenshots attached, i have same add two for the 180 and the 270 degrees.

Revision history for this message
Olivier Girard (eolinwen) wrote :
Revision history for this message
Olivier Girard (eolinwen) wrote :
Revision history for this message
Olivier Girard (eolinwen) wrote :
Revision history for this message
Olivier Girard (eolinwen) wrote :
Revision history for this message
Olivier Girard (eolinwen) wrote :
Andy Finch (fincha)
Changed in openshot:
status: Fix Committed → Fix Released
Revision history for this message
Jonathan Thomas (jonoomph) wrote :

This patch has caused some regressions with other numeric values in certain locales, such as sv_SE. The LC_NUMERIC variable needs to be set to the correct locale, rather than hard coded to C or POSIX (which always uses a period for decimal places). One of the regressions is muted audio, when the volume is not set to 100%.

Changed in openshot:
milestone: 1.2.0 → 1.4.1
status: Fix Released → Fix Committed
Changed in openshot:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.