bugGNU TeXmacs - Bugs: bug #38566, cannot insert images due to cork...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #38566: cannot insert images due to cork encoding

Submitter:  Darcy Shen <sadhen>
Submitted:  Fri 22 Mar 2013 09:02:20 AM UTC
   
 
Category:  File Manager Priority:  5 - Normal
Item Group:  Error Status:  Fixed
Privacy:  Public Assigned to:  mdbenito
Originator Name:  Open/Closed:  Closed
Release:  None Release: 
Fixed Release:  None Fixed Release:  SVN 7243
Keywords: 

Jump to the original submission

Thu 05 Sep 2013 03:04:59 PM UTC, comment #11: 

Great, it works!

This bug is fixed for me. Thanks a lot.

Francois Poulain <fpoulain>
Group Member
Thu 05 Sep 2013 12:26:54 PM UTC, comment #10: 

Your welcome. I test this as soon as I find proper Internet with ssh working on it. :)

Francois Poulain <fpoulain>
Group Member
Thu 05 Sep 2013 09:54:27 AM UTC, comment #9: 

Ooops! Indeed, I forgot one file. Sorry for the sloppy commit :(

Miguel de Benito <mdbenito>
Group Member
Thu 05 Sep 2013 07:17:40 AM UTC, comment #8: 

I got this compilation error:

./Plugins/Qt/qt_chooser_widget.cpp: In member function ‘void qt_chooser_widget_rep::perform_dialog()’:
./Plugins/Qt/qt_chooser_widget.cpp:241:13: error: ‘class QTMFileDialog’ has no member named ‘setNameFilters’

Did you add all in svn?

Francois Poulain <fpoulain>
Group Member
Wed 04 Sep 2013 10:14:45 PM UTC, comment #7: 

Oops, fixed and fixed. Also added a default "All files (.)" to avoid getting in the way.

I'm closing this bug. Please reopen if problems appear.

Miguel de Benito <mdbenito>
Group Member
Wed 04 Sep 2013 01:49:57 PM UTC, comment #6: 

Also, I see weird filters, like e.g. "*.*.tex" in place of "*.tex"; anyway it seems to work as expected.

Francois Poulain <fpoulain>
Group Member
Wed 04 Sep 2013 01:41:52 PM UTC, comment #5: 

Wooot! Thanks. Works for me when I load pictures. :)

Anyway, when I open a TeXmacs file, the filter is too strict: only directories are shown.

Francois Poulain <fpoulain>
Group Member
Tue 03 Sep 2013 09:16:57 PM UTC, comment #4: 

Indeed, that ifdef was pretty ugly. I rewrote that code and now:

 - File formats and extensions are not hardcoded anymore
 - Images are also resized when using native dialogs (Mac/Win) (defaults to 1/3 of page width)
 - filename encoding conversion is consistently done (but possibly wrong!)

Please test.

Miguel de Benito <mdbenito>
Group Member
Tue 03 Sep 2013 12:43:02 PM UTC, comment #3: 

Here is a patch you can try.

I let Miguel reviewing it and pushing it, since he is the original author of this part.

Miguel, don't you think that the big "#if (defined(Q_WS_MAC) || defined(Q_WS_WIN))" is a little too big?

(file #28992)

Francois Poulain <fpoulain>
Group Member
Tue 03 Sep 2013 09:31:27 AM UTC, comment #2: 

Hi Darcy, I can reproduce the bug. I will look at it.

François

Francois Poulain <fpoulain>
Group Member
Sat 13 Apr 2013 03:15:49 PM UTC, comment #1: 

I was wrong.Today I carefully read the source code and find that
in file: qt_chooser_widget.cpp
    if (fileNames.count() > 0) {
      file = from_qstring (fileNames[0]);
      url u = url_system (scm_unquote (file));
      cerr << "Debugging"<<u;
      QByteArray arr= to_qstring (as_string (u)).toLocal8Bit ();
      const char* cstr= arr.constData ();
      string localname = string ((char*) cstr);
      if (type == "image")
        file = "(list (system->url " *
        scm_quote (as_string (u)) *
        ") " imgdialog->getParamsAsString () ")";
      else
        file = "(system->url " scm_quote (localname) ")";
    }

here from_qstring is actually changing the encoding to cork
and I try to load a file named 你好.tm , It works. But when I try to insert a image with Chinese in the filename, it failed.

I find that there is as_string, I guess something gets wrong in url.cpp, but currently I haven't found it.

Darcy Shen <sadhen>
Group Member
Fri 22 Mar 2013 09:02:20 AM UTC, original submission:  

I have a image file named "你好.png". When I try to insert the image by Insert->Image->Insert Image... , it failed to load because of the encoding problem.

I think making minor changes in src/src/System/Files/images_files.cpp before calling the function load_string will fix the bug.

Darcy Shen <sadhen>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #28992:  qt_chooser_widget.diff added by fpoulain (585B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mdbenito (Posted a comment)
  • -email is unavailable- added by sadhen (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-04 mdbenito StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseSVN 7233 SVN 7243
    2013-09-04 fpoulain StatusReady For Test In Progress
    2013-09-03 mdbenito Item GroupNone Error
        StatusWorks For Me Ready For Test
        Fixed Release SVN 7233
    2013-09-03 fpoulain Attached File- Added qt_chooser_widget.diff, #28992
        StatusConfirmed Works For Me
        Assigned tofpoulain mdbenito
    2013-09-03 fpoulain StatusNone Confirmed
        Assigned toNone fpoulain

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code