Templot Club Archive 2007-2020                             

topic: 2246Access violation when saving background shapes
author remove search highlighting
 
posted: 2 Jul 2013 11:21

from:

richard_t
 
Nr. Spalding, South Holland - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Hi

I get an "Access violation at address 00403030 in module 'templot_2.exe'. Write of address 00000000." when saving background shapes containing a large-ish image. Templot continues and the background shape file is saved - but on reloading I need to manually reload the image.

My system is Windows 7 x64 with 4Gb of RAM. The image is 384Mb in size, and a windows bitmap file. Templot itself is installed into c:\TEMPLOT_DEV, and I get the error if I try to save the background shapes file to a project folder (D:\Model Railways\Manchester Central Lines\Drawings\Templot\background_shapes for example), or if I save it into the default location (C:\TEMPLOT_DEV\SHAPE-FILES). The image itself comes from the above location (d:\Model Railways....), and the C:\TEMPLOT_DEV\IMAGE-FILES folder just contains the dummy.txt file.

Steps to reproduce:

  1. Open Templot
  2. Session > project box title "Manchester Central Lines - Background Image"
  3. Session > gauge and scale "S7"
  4. Main > Background shapes
  5. New Shape > Picture > Add Shape > Scanned Map or prototype track plan
  6. X : O, Y : 0, DPI (both): 322.375, map scale ratio 1: 500
  7. (select file)
  8. save all as...
  9. (select file)
  10. Message box with access violation.
I appreciate you might not be able to do much without the image, but I've had copyright issues with the scans I've had from GMCRO in the past, so I'm happy to send you it privately, but not to put it on here.

Thanks

Richard.

posted: 2 Jul 2013 11:51

from:

Martin Wynne
 
West Of The Severn - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Hi Richard,

Thanks for the report.

A 384MB BMP file is rather more than "large-ish", it's very large. :shock:

What is the image size in pixels? What is the colour bit-depth? How many picture shapes in the BGS file? Does it display and zoom ok on the trackpad? Does it appear ok in the output and on the sketchboard?

What happens if you convert it to PNG format in a graphics editor before using it in Templot?

I would like to see it, but I don't think my email will accept an attachment of that size, nor the Templot Club forum database.

Do you have some web space to which you could upload it, and from which I could then download it?

regards,

Martin.

posted: 2 Jul 2013 13:40

from:

richard_t
 
Nr. Spalding, South Holland - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides

Martin Wynne wrote:
Hi Richard,

Thanks for the report.

A 384MB BMP file is rather more than "large-ish", it's very large. :shock:

What is the image size in pixels? What is the colour bit-depth? How many picture shapes in the BGS file? Does it display and zoom ok on the trackpad? Does it appear ok in the output and on the sketchboard?

What happens if you convert it to PNG format in a graphics editor before using it in Templot?

I would like to see it, but I don't think my email will accept an attachment of that size, nor the Templot Club forum database.

Do you have some web space to which you could upload it, and from which I could then download it?

regards,

Martin.

The image size is 14302x9161 (pixels), 24bpp - Templot is OK (as in I can save the background shapes with no errors), with the same image but 1 bit (i.e. B/W). I'll try again with something in-between. Nothing else in the BGS file, and the 24bpp image displays OK in the trackpad, and all zooming is fine (unless I have transparent option enabled, but I don't have that on usually). 

Templot doesn't seem to like it as a PNG file, Templot just "seems" to stall whilst trying to load it - in fact just trying to select it takes a long time - I guess as the "picture" control in the load image into picture shape window, is trying to show it.

The image doesn't appear in the sketchpad, although if I set the "with borders" option, I can see the border. And I don't seem to be able to get it to output in the PDF generator either, but does seem to output OK in a PNG file - I didn't try the others.

I'll send you a PM over where I can store the image for you to download.

 

Richard.

posted: 2 Jul 2013 14:46

from:

richard_t
 
Nr. Spalding, South Holland - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Hi

Just tested with 16bpp, with the same result as 24bpp, which isn't surprising as the file sizes are the same. Converting the image to greyscale, and then storing as 8bpp (and 4bpp), works a treat - so I'll stick with that.

Richard.

posted: 2 Jul 2013 15:13

from:

Trevor Walling
 
United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Hello,
Templot just "seems" to stall whilst trying to load it - in fact just trying to select it takes a long time
What processor is in your computer as that could be something to do with this issue?It involves a lot of processor activity to carry out some actions in Templot and something that size takes some time with slower processors especially if they are single core.I find I have to wait sometimes even with a triple core 3200Ghz processor when doing more work intensive processes.
Trevor.

posted: 2 Jul 2013 15:25

from:

richard_t
 
Nr. Spalding, South Holland - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
This PC has Intel dual core 2.66Ghz processor in it running at 3.2Ghz :-D

posted: 4 Jul 2013 11:10

from:

Martin Wynne
 
West Of The Severn - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Hi Richard,

Thanks for sending the image file.

At around 15000 x 9000 it really is far larger than anything I have previously imagined using, or tested, in a Templot picture shape, so I'm not surprised there are problems.

Much the easiest solution would be to split it into several smaller picture shapes, and place them side-by-side on the trackpad. 4 sections each 7500 x 4500 would still be regarded as large. 9 sections each 5000 x 3000 would be more typical.

As you have found, changing to grey-scale, or 8-bit indexed colour, does significantly reduce the file size and memory requirements.

Having said that, the full file does actually load and save ok on my system. Saving is very slow because of the conversion to PNG format for the SK81 file, but it does eventually complete without errors, and reload again later ok. Windows marks Templot as "not responding" with the hourglass / spinning roundel showing while saving, but if you wait long enough it does come back without error.

But that's just my system, I wouldn't want to guarantee that Templot can handle such large files on all systems. There has to be a limit somewhere -- the difficulty is in specifying what it is, because all systems are different.

Here is a tiny bit of it on the trackpad with a turnout aligned over it. I hope this small section falls within fair dealing for copyright purposes:

2_040506_390000000.png2_040506_390000000.png

I was pleasantly surprised to find zooming and panning on the trackpad quite fast and smooth. :)

It wouldn't transfer to the sketchboard in the default metafile format -- I got a streaming "out of memory" error, not really surprising.

But by changing to the manual option to add the trackplan item in bitmap format, and using the boundary rectangle* option (the green outline above), it did work. This is the sketchboard view: 

2_040506_400000001.png2_040506_400000001.png

However, I couldn't get it into the PDF or print outputs. Partly that's because of the high degree of zoom needed, but also because picture shape bitmaps have to be rotated 90 degrees from the trackpad view to mach the template output -- requiring further large amounts of memory to perform the rotation.

I'm going to have another look at the code for including picture shapes in the output, to see if I can reduce the memory requirement, and speed things up. Also to reduce the PDF file size for multiple small pages (which is massive if picture shapes are included, compared to the same thing as a single large page).

Thanks again for sending the file.

regards,

Martin.

*For the metafile format, the boundary rectangle must contain the entire picture shape.

posted: 4 Jul 2013 11:23

from:

Martin Wynne
 
West Of The Severn - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
richard_t wrote:
This PC has Intel dual core 2.66Ghz processor in it running at 3.2Ghz :-D
Hi Richard.

Over-clocking?

I can't offer any guarantee that Templot will work properly on such systems. I would prefer that reports of problems are confined to systems running within design spec.

regards,

Martin.


posted: 4 Jul 2013 14:48

from:

richard_t
 
Nr. Spalding, South Holland - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides

Martin Wynne wrote:
richard_t wrote:
This PC has Intel dual core 2.66Ghz processor in it running at 3.2Ghz :-D
Hi Richard.

Over-clocking?

I can't offer any guarantee that Templot will work properly on such systems. I would prefer that reports of problems are confined to systems running within design spec.

regards,

Martin.


 

I've tried it again at the native speed of the processor, but it was the same. Thanks for all those suggestions.

Richard.


posted: 9 Jul 2013 21:25

from:

Paul Boyd
 
Loughborough - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Hi Martin
because of the conversion to PNG format for the SK81 file
Just out of curiosity, as an SK81 file does just seem to be a PNG file, why use .sk81 instead of .png?

I've occasionally wanted to edit the image and have to change the filetype to png, edit it, then change it back to sk81.  It seems to work OK!

Cheers

posted: 9 Jul 2013 22:00

from:

Martin Wynne
 
West Of The Severn - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Paul Boyd wrote:
Just out of curiosity, as an SK81 file does just seem to be a PNG file, why use .sk81 instead of .png?

I've occasionally wanted to edit the image and have to change the filetype to png, edit it, then change it back to sk81. It seems to work OK!
Hi Paul,

If you have more than one picture shape in a BGS file, the first image is saved as SK81, the second as SK82, and so on.

The image data is saved in PNG format so I could have used PNG1, PNG2 -- but that looks a bit like an error and liable to be "corrected" to .png by the unknowing.

I did an exhaustive search of the web to avoid conflicts with other software before deciding on the range SK0 to SK9 for the new file formats in Templot2 (SK=sketchboard).

Also, at one stage during TDV development I was using the arcane HCK image format -- which saves and loads much faster than PNG and is native to the sketchboard engine. In the end I decided against it so that users could if necessary do exactly what you are doing to edit the file as a PNG.

Take care to rename it correctly afterwards if you have more than one picture shape. :)

regards,

Martin.

posted: 10 Jul 2013 09:29

from:

Paul Boyd
 
Loughborough - United Kingdom

click the date to link to this post
click member name to view archived images
view images in gallery view images as slides
Hi Martin
If you have more than one picture shape in a BGS file, the first image is saved as SK81, the second as SK82, and so on.
Ah, yes, that makes a lot of sense!  Thanks for the explanation :D



Templot Club > Forums > I found a flaw > Access violation when saving background shapes
about Templot Club

Templot Companion - User Guide - A-Z Index Templot Explained for beginners Please click: important information for new members and first-time visitors.
indexing link for search engines

back to top of page


Please read this important note about copyright: Unless stated otherwise, all the files submitted to this web site are copyright and the property of the respective contributor. You are welcome to use them for your own personal non-commercial purposes, and in your messages on this web site. If you want to publish any of this material elsewhere or use it commercially, you must first obtain the owner's permission to do so.
The small print: All material submitted to this web site is the responsibility of the respective contributor. By submitting material to this web site you acknowledge that you accept full responsibility for the material submitted. The owner of this web site is not responsible for any content displayed here other than his own contributions. The owner of this web site may edit, modify or remove any content at any time without giving notice or reason. Problems with this web site? Contact webmaster@templot.com.   This web site uses cookies: click for information.  
© 2020  

Powered by UltraBB - © 2009 Data 1 Systems