Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


6 Pages«<3456>
Options
Go to last post Go to first unread
Offline Alex M.  
#81 Posted : 18 May 2016 02:29:29(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
Found it! Seems related to the exceptions

1. Add a region in the canvas;
2. add in the placeholder something like mat(identity(3),identity(3),identity(3),1,3);
3. change one of the RGB channels with a number (e.g. 1) -> mat(identity(3),1,identity(3),1,3);
4. double-click will launch the image viewer;


BTW, you should propagate the evaluation exceptions to the user, currently you can't notice when something fails in the evaluation...


Fixed
thanks 1 user thanked Alex M. for this useful post.
on 18/05/2016(UTC)
Offline Davide Carpi  
#82 Posted : 18 May 2016 21:12:23(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: Alex.M Go to Quoted Post
Fixed

Thank you Alex Good

I just noticed that the double-click issue happens even when you open an existing worksheet having the "auto calculation" feature disabled (until you launch a recalculation, then it works fine).
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Alex M.  
#83 Posted : 22 May 2016 21:06:05(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Plugin update:

- Printable resolution of displayed PDF and SVG (and file types that depend on these) was increased to 300 DPI.
- Scaling down bug in print preview / print output of image region is fixed
- Re-sizing of the region is smoother and produces better quality graphics
- Few general improvements

On this note, do you guys know what is the easiest way to get current system DPI? Similar to below throws an error "'ImageEdit.ImageCanvas' does not contain a definition for 'CreateGraphics' and no extension method 'CreateGraphics' accepting a first argument of type 'ImageEdit.ImageCanvas' could be found"
http://stackoverflow.com...windows-display-settings


Originally Posted by: Davide Carpi Go to Quoted Post
Originally Posted by: Alex.M Go to Quoted Post
Fixed

Thank you Alex Good

I just noticed that the double-click issue happens even when you open an existing worksheet having the "auto calculation" feature disabled (until you launch a recalculation, then it works fine).


Davide, it seems that prior to evaluation I have only two choices - either to allow the double click or not. What would be a good reason for choosing "No" over "Yes" here?

Edited by user 22 May 2016 21:13:40(UTC)  | Reason: Not specified

thanks 1 user thanked Alex M. for this useful post.
on 22/05/2016(UTC)
Offline Davide Carpi  
#84 Posted : 23 May 2016 02:55:25(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: Alex.M Go to Quoted Post
On this note, do you guys know what is the easiest way to get current system DPI?

Andrey provided an useful:
Code:
GlobalParams.ScreenDpi

Otherwise I think you have to pass through Graphics
Code:
using (Graphics g = Graphics.FromImage(new Bitmap(1,1)))
{
    float dpiX = g.DpiX;
    float dpiY = g.DpiY;
}


Originally Posted by: Alex.M Go to Quoted Post
Davide, it seems that prior to evaluation I have only two choices - either to allow the double click or not. What would be a good reason for choosing "No" over "Yes" here?

I don't know; imho the best approach is to filter the click region, then you can choose what's the best for you as developer, the important thing for me is to not cause troubles when editing stuff in the placeholder. Good
Code:
if (!base.dblclick.Enabled)
{
    Rectangle canvas = new Rectangle(new Point(1,1), this.canv.Size);

    if (canvas.Contains(e.Location))
        base.dblclick.Enabled = true;
}


If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Alex M.  
#85 Posted : 24 May 2016 00:15:03(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Plugin Update:

- Double click has no effect in the placeholder portion of the region
- Latest library Svg.dll 2.2.0 included https://github.com/vvvv/SVG
- Rendering speed of complex SVG was significantly increased (x50) by applying this, potentially incorrect, fix https://github.com/vvvv/SVG/issues/208
- Ability to import ANY file type. The manual render of the file (png, pdf, svg or psd) will be sought for in either root folder of the .sm document or C:\Users\USERNAME\AppData\Roaming\SMath\extensions\plugins\63ddaef8-9a56-4ff6-938e-d590b638bf99\Temp. It is expected that the render will have same filename (different extension) as the file that opens on double click of the image region. Note that mentioned file name IS NOT THE SAME as the filename of the imported file.

Edited by user 24 May 2016 19:27:35(UTC)  | Reason: Not specified

thanks 1 user thanked Alex M. for this useful post.
on 24/05/2016(UTC)
Offline mkraska  
#86 Posted : 11 September 2016 01:27:27(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
There seems to be a problem in the SVG engine

see SS-2397

Alex, what is your username in the bug tracking system?
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#87 Posted : 11 September 2016 03:08:22(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
If I try to import a png-file, then the dialog opens with path C:\

I propose to change the default path to the document directory or current directory if the doc is not yet saved.

EDIT: filed as SS-2399

Edited by user 12 September 2016 14:46:38(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#88 Posted : 12 September 2016 14:48:22(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
There are image display problems if the file name is given in the placeholder.

details, screenshot, example files under SS-2400
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#89 Posted : 12 September 2016 21:13:41(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: mkraska Go to Quoted Post
There seems to be a problem in the SVG engine

see SS-2397

Alex, what is your username in the bug tracking system?


Martin, how an engine renders SVG is out of my control. I can check if problem persists with SVGSharp, but that engine has its own issues. If you know a particular revision of SVG or SVGSharp library that renders your file correctly let me know.


Originally Posted by: mkraska Go to Quoted Post
If I try to import a png-file, then the dialog opens with path C:\

I propose to change the default path to the document directory or current directory if the doc is not yet saved.

EDIT: filed as SS-2399


I will see what I can do


Originally Posted by: mkraska Go to Quoted Post
There are image display problems if the file name is given in the placeholder.

details, screenshot, example files under SS-2400


THis should be an easy fix


I hope to work on the plugin upcoming weekend.

Edited by user 12 September 2016 22:48:13(UTC)  | Reason: Not specified

Offline mkraska  
#90 Posted : 13 September 2016 00:57:23(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: Alex.M Go to Quoted Post

Martin, how an engine renders SVG is out of my control. I can check if problem persists with SVGSharp, but that engine has its own issues. If you know a particular revision of SVG or SVGSharp library that renders your file correctly let me know.

The image region as it was 2 years ago did render my files correctly. Actually, the files are generated by gnuplot, thus we could play around a bit with terminal settings. The Maxima Draw regions (Maxima plugin) also render svg images (they were developed based on the original image region). These DrawRegions are not very mature, therefore currently they are not a general option for plotting with Maxima.

Originally Posted by: Alex.M Go to Quoted Post

I hope to work on the plugin upcoming weekend.

Thanks a lot.

BTW, in my recent testing I experienced problems with simultaneous file access. Perhaps Maxima (Gnuplot) and the Image region try to lock the file.
For Maxima to display graphics, it is essential that images shown in the Image region can be updated dynamically without being locked by the Image region.

If things get too complex, possibly, an option could be to have a separate region for display of images and one for import/create/editable images.


Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#91 Posted : 13 September 2016 18:15:22(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: mkraska Go to Quoted Post
Originally Posted by: Alex.M Go to Quoted Post

Martin, how an engine renders SVG is out of my control. I can check if problem persists with SVGSharp, but that engine has its own issues. If you know a particular revision of SVG or SVGSharp library that renders your file correctly let me know.

The image region as it was 2 years ago did render my files correctly. Actually, the files are generated by gnuplot, thus we could play around a bit with terminal settings. The Maxima Draw regions (Maxima plugin) also render svg images (they were developed based on the original image region). These DrawRegions are not very mature, therefore currently they are not a general option for plotting with Maxima.

Originally Posted by: Alex.M Go to Quoted Post

I hope to work on the plugin upcoming weekend.

Thanks a lot.

BTW, in my recent testing I experienced problems with simultaneous file access. Perhaps Maxima (Gnuplot) and the Image region try to lock the file.
For Maxima to display graphics, it is essential that images shown in the Image region can be updated dynamically without being locked by the Image region.

If things get too complex, possibly, an option could be to have a separate region for display of images and one for import/create/editable images.





Martin, could you provide a clear example demonstrating the file access issue? It will simplify debugging.


Also what image file formats can MAXIMA output? True vector graphics in .NET is metafile (emf), which renders well in Smath, then there is pdf which also renders well. Both SVG renders I tried have their own quirks... I will test SVGSharp to see if I can get SVG resizing work correctly (I failed last time) and if it will work with DISLIN, another plugin which uses Image Region.

Thanks

Edited by user 13 September 2016 18:25:22(UTC)  | Reason: Not specified

Offline mkraska  
#92 Posted : 13 September 2016 20:12:24(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: Alex.M Go to Quoted Post


Martin, could you provide a clear example demonstrating the file access issue? It will simplify debugging.
Thanks


The behaviour, which the display of gnuplot-generated images (that is what Maxima produces) relies on is this:

- if a name in the placeholder of the image region is given, then the region tries to display that image.
- if the image does not exist, nothing is displayed.
- if the file appears in the file system, the image is displayed
- if the file changes, the display is updated
- existance and update checks are done upon re-calculation. Perhaps sort of delay for reading the file is required if the file is still written while the image region tries to access it.

Currently, whenever a file generation fails due to some error on Maxima side, then I get a dialog asking if the file should be generated. If I confirm, then a file is written but possibly not closed immediately, as the file manager complains about an invalid image file.
May that lead to a conflict, when some process tries to write the file?

An example, where a clearly existing png image is ignored by the Image region, is given in the attachment of http://smath.info/bts/Issues/IssueDetail.aspx?id=2400


Originally Posted by: Alex.M Go to Quoted Post


Martin, could you provide a clear example demonstrating the file access issue? It will simplify debugging.


Also what image file formats can MAXIMA output? True vector graphics in .NET is metafile (emf), which renders well in Smath, then there is pdf which also renders well. Both SVG renders I tried have their own quirks... I will test SVGSharp to see if I can get SVG resizing work correctly (I failed last time) and if it will work with DISLIN, another plugin which uses Image Region.

Thanks


Gnuplot can produce pdf images, however, I never tried that. Going for that option would require some rework of the Draw functions in the Maxima plugin, as currently, only svg (default) or png are supported. Easiest workaround would perhaps be the switch from svg to png as default image format.

The internal MaximaDrawregion uses these functions:

using SharpVectors.Dom.Svg;
using SharpVectors.Renderers.Forms;
using SharpVectors.Renderers.Gdi;

This seems to work for gnuplot generated images.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#93 Posted : 25 September 2016 21:15:19(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: mkraska Go to Quoted Post
There are image display problems if the file name is given in the placeholder.

details, screenshot, example files under SS-2400



Martin, this was partially fixed (build 6103). Smath workbook attached in the bug report displays correctly. File access problem was fixed. Clone/copy was fixed. Proper rendering of SVG files produced by Maxima was not fixed since the only solution (roll back to a different render engine) will create a different set of rendering issues.

Edited by user 05 October 2016 20:10:41(UTC)  | Reason: Not specified

Offline mkraska  
#94 Posted : 22 February 2017 17:37:23(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
I filed a bug report at http://smath.info/bts/Is...IssueDetail.aspx?id=2432

There you find some illustrations (too cumbersome to add here).

Essentially, the image region can overwrite image files unexpectedly.

How to reproduce the problem:

save the attached sm file and png image to any folder.
open the sm file
clone the image region using Ctrl-drag
replace the filename in the new region placeholder by the variable name Grau
recalculate

What happens:

- The original region turns grey and you find that the file "fhb_logo_neu.png" has been overwritten (is now grey instead of red)

- perhaps also SMath gets stuck. You can, however, save the file and re-open SMath.

I expect the display of files using image regions not to backfire to the image file under any circumstances. My guess on what might happen (without any real insight):

- any image region has an external file name attribute which is set if you write a file name to the placeholder

- The file name is only changed if a new file name is specified, but not if the file name is replaced by a variable (a random unique file name should be used in that case, if required at all)

- upon cloning the region, this file name is not changed

- if the contents of the image changes, then the external file is synchronized.

If these assumptions are correct, then the problem is the item in bold.

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#95 Posted : 22 February 2017 17:54:53(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: mkraska Go to Quoted Post
I filed a bug report at http://smath.info/bts/Is...IssueDetail.aspx?id=2432

There you find some illustrations (too cumbersome to add here).

Essentially, the image region can overwrite image files unexpectedly.

How to reproduce the problem:

save the attached sm file and png image to any folder.
open the sm file
clone the image region using Ctrl-drag
replace the filename in the new region placeholder by the variable name Grau
recalculate

What happens:

- The original region turns grey and you find that the file "fhb_logo_neu.png" has been overwritten (is now grey instead of red)

- perhaps also SMath gets stuck. You can, however, save the file and re-open SMath.

I expect the display of files using image regions not to backfire to the image file under any circumstances. My guess on what might happen (without any real insight):

- any image region has an external file name attribute which is set if you write a file name to the placeholder

- The file name is only changed if a new file name is specified, but not if the file name is replaced by a variable (a random unique file name should be used in that case, if required at all)

- upon cloning the region, this file name is not changed

- if the contents of the image changes, then the external file is synchronized.

If these assumptions are correct, then the problem is the item in bold.



I will take a look at this bug and WIN10 issues hopefully upcoming weekend.

Existing file modification is unacceptable; frankly off the top of my head I have no idead why would this happen.

Actually nevermind that, I think I know what is happening.
1. you specify an image path in a placeholder; the name of the image is saved
2. the image gets copied to the temporary folder to be saved saved within smath document
3. you "read" image into a single matrix variable
4. you substitute variable into image region placeholder; unless variable is in a format [ [R] [G] [B] ] it is interpreted as a grayscale png
5. This grayscale PNG is saved with the same filename as original image

There is more than one way to fix this. Let me know your preferred fix. Also out of curiosity what were you trying to achieve by this workflow?

Edited by user 22 February 2017 18:04:41(UTC)  | Reason: Not specified

thanks 1 user thanked Alex M. for this useful post.
on 22/02/2017(UTC)
Offline mkraska  
#96 Posted : 22 February 2017 18:43:19(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Cloning existing regions and subsequent modification is a typical element of my workflow for creating documents. Ctrl-drag isn't even half the interaction required compared to copy/paste even if you use keyboard shortcuts.

It is the most convenient way to create new regions if you need them with similar settings, in the given case with similar size.

I think in the given case it would be sufficient to modify the internal file name (switch to a randomly generated one) as soon as the contents of the placeholder is changed.

Just to be safe, you also could open files specified in the placeholder read-only (in fact, I exptected this to be this way). I am not aware of an Image region feature where one would need to write to that file.

How about using the bug tracking system? We could exchange comments there without creating noise in the user forum... The editor for posts is much better there (you can copy images from the clipboard).


Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#97 Posted : 27 February 2017 19:28:11(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
Issues are are form's fonts changed, desktop background visible through the window and these. I'll see if I can help Alex, as pointed out the issues are related to windows 10 only.


Davide if you point out what portion of the plugin code is loaded before one inserts the region I could sift through it and see if there is anything related to DPI? I remember using DPI values in the code and I might have made a mistake and implemented something I did not intend.

Also this will happen when I get some time off work - I was working on weekend again
Offline Alex M.  
#98 Posted : 02 March 2017 23:44:54(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: mkraska Go to Quoted Post
Cloning existing regions and subsequent modification is a typical element of my workflow for creating documents. Ctrl-drag isn't even half the interaction required compared to copy/paste even if you use keyboard shortcuts.

It is the most convenient way to create new regions if you need them with similar settings, in the given case with similar size.

I think in the given case it would be sufficient to modify the internal file name (switch to a randomly generated one) as soon as the contents of the placeholder is changed.

Just to be safe, you also could open files specified in the placeholder read-only (in fact, I exptected this to be this way). I am not aware of an Image region feature where one would need to write to that file.

How about using the bug tracking system? We could exchange comments there without creating noise in the user forum... The editor for posts is much better there (you can copy images from the clipboard).




This has been fixed.

I will need a hand with WIN10 and DPI issue because righgt now im poking in the dark
thanks 3 users thanked Alex M. for this useful post.
on 03/03/2017(UTC),  on 03/03/2017(UTC),  on 03/03/2017(UTC)
Offline Alex M.  
#99 Posted : 16 November 2017 20:38:13(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Davide has fixed the DPI related issue of Image Region on the WIN10 machines. I have tested it extensively over weekend and all seems to be in order.

Image Region is ready for the future!

Thank you, Davide
thanks 1 user thanked Alex M. for this useful post.
on 16/11/2017(UTC)
Offline mkraska  
#100 Posted : 18 November 2017 15:07:30(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: Alex M. Go to Quoted Post
Davide has fixed the DPI related issue of Image Region on the WIN10 machines. I have tested it extensively over weekend and all seems to be in order.

Image Region is ready for the future!

Thank you, Davide


I have updated the portable distribution.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Users browsing this topic
6 Pages«<3456>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.