3.27.9 question about (images relative path) solved

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
User avatar
bambuko
Premier Member
Posts: 192
Joined: Fri Jul 02, 2021 6:20 pm
Location: UK, England, North Devon

3.27.9 question about (images relative path) solved

Post by bambuko » Fri Jan 20, 2023 6:10 pm

latest release includes the following (for Pro version):
Images:
Allow storing relative paths for images in DXF/DWG
I am somewhat confused...
does it "allow storing"??
or does it convert everything to "relative path"??

I have project folders with included images and until now, it was a simple matter to copy the folder, give it new name and everything remained contained in this folder (including the images).

Now, when I copy project folder, images in OCAD file have a path to original folder rather than a new folder.

On one hand I always wanted this as an option, but I am confused by this implementation :oops:
Can someone, please explain (or point to the explanation).

PS also - it seems to have happened before 3.27.9 ?? because I discovered this behaviour in 3.27.8??

Code: Select all

Version: 3.27.8.0 (3.27.8)
Internet: QCAD.org
Build Date: Oct 6 2022
Revision: dea3962
Qt Version: 5.8.0
Architecture: x86_64
Compiler: gcc 4.8.1
Last edited by bambuko on Sun Jan 22, 2023 2:59 pm, edited 1 time in total.
QCad Pro
Linux MX-23.5_KDE_x64 Libretto

User avatar
andrew
Site Admin
Posts: 8769
Joined: Fri Mar 30, 2007 6:07 am

Re: 3.27.9 question about (images relative path)

Post by andrew » Fri Jan 20, 2023 8:46 pm

bambuko wrote:
Fri Jan 20, 2023 6:10 pm
does it "allow storing"??
or does it convert everything to "relative path"??
It allows for relative paths to be stored in DXF/DWG rather than always storing the absolute path (QCAD <= 3.27.8).

If you change the path of an image to a relative path using the property editor, QCAD will leave it at exactly what you entered.
bambuko wrote:
Fri Jan 20, 2023 6:10 pm
I have project folders with included images and until now, it was a simple matter to copy the folder, give it new name and everything remained contained in this folder (including the images).
QCAD looks up images from the absolute (or relative) path as stored in the DXF. If the image is not found there, it resorts to the same folder where the DXF is stored. So the path stored in the DXF is always preferred but the same folder as the DXF always works. This is not something that has changed but might be something you had not previously noticed. If you copy a project folder, this does not automatically change any paths in the DXF (QCAD is not even involved at all in this operation as you are using a file manager to copy the folder).

The new thing is that you can manually adjust the path in the property editor, for example from /path/to/image/file.png (absolute) to image/file.png (relative). So your project folder might contain subfolders and you can still copy or move it around without breaking image paths.

User avatar
bambuko
Premier Member
Posts: 192
Joined: Fri Jul 02, 2021 6:20 pm
Location: UK, England, North Devon

Re: 3.27.9 question about (images relative path)

Post by bambuko » Fri Jan 20, 2023 9:17 pm

I will experiment, thank you for the explanation!

It is a bit confusing at the moment e_confused
QCad Pro
Linux MX-23.5_KDE_x64 Libretto

User avatar
bambuko
Premier Member
Posts: 192
Joined: Fri Jul 02, 2021 6:20 pm
Location: UK, England, North Devon

Re: 3.27.9 question about (images relative path)

Post by bambuko » Sat Jan 21, 2023 10:05 am

I have attached a zipped folder with a scenario that causes me concern.

I have original folder "test_v00"
It has .dxf file and .jpg inserted in it.

I now create a copy of this folder "test_v00 (copy)"
In my work I would rename it test_v01 and continue working on it, but I left it here as (copy) to keep it clear.
If I now modify .jpg (have a look at it - it is modified :mrgreen: ) it doesn't show in .dxf
image inserted still points to original folder :? rather than looking up at absolute/local in the first place....

I know now that I can modify path in image property (very welcome improvement),
but.... managing project folder (consisting of .dxf plus all inserted images) causes me concern.
I guess it was all fine until I started messing up with modifying the inserted images (I blame gimp :wink: )

perhaps toggle switch (in preferences?)
to switch between absolute (i.e. just image name) and relative (i.e. image name with path) ???
Attachments
QCAD_test.zip
(152.34 KiB) Downloaded 787 times
QCad Pro
Linux MX-23.5_KDE_x64 Libretto

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: 3.27.9 question about (images relative path)

Post by CVH » Sat Jan 21, 2023 12:38 pm

bambuko,

First of all:
When I modify a picture for some reason I store it renamed.
Mainly because several pictures called 'pic1.png' don't tell me anything.
'pic1-cropped.png' for including in QCAD or 'pic1-lowRes.png' for display/forum purpose do ...
... And the relation with the original 'pic1.png' is quite clear.

Same goes for dxf files ... 'drawing1-v2.dxf' tells me that it is version two of 'drawing1', and/or the successor.
'drawing1-final.dxf' will tell me that it is the final version, even several years later. :wink:

In your example the folder differentiates between original and copies.
QCAD is not aware of the intended difference between 'image_a.jpg' in the original folder and 'image_a.jpg' in the new copy.

Like said by Andrew, it will revert to the drawing path when not found in the stored path.
But in your case it does exist in the stored path with the exact same name and QCAD will not revert to the drawing path.

The solution for you is storing a relative path ... The dxf file path or only the file name.
QCAD will then only look for it in the drawing path.
But you will still have several different pictures (and drawings) with the same name ... :roll:

Regards,
CVH

User avatar
bambuko
Premier Member
Posts: 192
Joined: Fri Jul 02, 2021 6:20 pm
Location: UK, England, North Devon

Re: 3.27.9 question about (images relative path)

Post by bambuko » Sat Jan 21, 2023 1:07 pm

As far as I am concerned, because QCAD does not store inserted image as part of .dxf file,
the only way to keep things safe and sensible for future is to have a "container" containing both .dxf and images used inside of it.

For me this container is simply a "folder" (or whatever it is called on either Win PC or MAC).
This folder controls versions and revisions etc. (NOT the .dxf and .jpg inside)

Absolute path for inserted .jpg makes it safe and possible.
Relative path for inserted .jpg creates confusion because my new/revised folder refers to images in the different/older folder.

You and I have different ways of working.
Yours works for you, mine works for me :lol:

I just wish that there was both absolute and relative path for image available for QCAD...

Having said al this, let me repeat - I am delighted with the recent improvement that allows me to control image path in the image properties.
QCad Pro
Linux MX-23.5_KDE_x64 Libretto

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: 3.27.9 question about (images relative path)

Post by CVH » Sun Jan 22, 2023 12:04 pm

bambuko wrote:
Sat Jan 21, 2023 1:07 pm
As far as I am concerned, because QCAD does not store inserted image as part of .dxf file,
Please read about the pro and cons with embedding a picture file:

https://autocadtips1.com/2013/02/22/emb ... reference/
No manipulation like rotating, scaling, cropping ...
Huge dwg/dxf file sizes because of the BMP format.
Max picture file size.
Display quality.
...

https://knowledge.autodesk.com/support/ ... -file.html
Environment: Microsoft Windows
bambuko wrote:
Sat Jan 21, 2023 1:07 pm
You and I have different ways of working.
Agreed, we all have our habits, mine is based on that the end of paths are truncated in the path column in windows explorer when searching.
On the other hand, I do not copy complete project 'containers' but I may save the files in a new location with a new name and then take it from there.
bambuko wrote:
Sat Jan 21, 2023 1:07 pm
I just wish that there was both absolute and relative path for image available for QCAD...
From my point of view all the above is now possible.
Absolute paths and reverting to drawing path was the former art ... Now relative paths are added.
But absolute and relative don't mix and it won't solve the duplicate naming ... :wink:

Regards,
CVH

User avatar
bambuko
Premier Member
Posts: 192
Joined: Fri Jul 02, 2021 6:20 pm
Location: UK, England, North Devon

Re: 3.27.9 question about (images relative path)

Post by bambuko » Sun Jan 22, 2023 1:33 pm

Thank you,
I am well aware of pros and cons of embedded ve linked images :wink:
I do not use .bmp precisely because of file size.
.jpg is perfectly adequate for my purposes

I don't really want embedded images, because of many advantages offered by linking.

I didn't think that "paste special" was available in QCAD? (hence I am puzzled by your links to Autocad?)
CVH wrote:
Sun Jan 22, 2023 12:04 pm
...Absolute paths and reverting to drawing path was the former art ...
No, it's still the current behaviour.
If QCAD cannot find the image where it is supposed to be located (as per image properties) it will look up where the .dxf is stored.
The only thing that has changed, is that now you can edit the path in image property editor.
see:
andrew wrote:
Fri Jan 20, 2023 8:46 pm
QCAD looks up images from the absolute (or relative) path as stored in the DXF. If the image is not found there, it resorts to the same folder where the DXF is stored....
What I am after is that simple:
Screenshot from 2023-01-22 12.30.00.jpeg
Screenshot from 2023-01-22 12.30.00.jpeg (28.51 KiB) Viewed 20732 times
You will see here just file name and NO path.
I had some difficulty previously modifying image property to remove the path - will need to do more experimenting to understand this behaviour.

later edit:
it seems to be working OK now. Maybe it was something to do with frozen layers not saving my changes correctly?
or... maybe it is because now I have updated from 3.27.8 to 3.27.9 ???
all previous tests have been done with 3.27.8
sorry if it is me being stupid
e_surprised :D :mrgreen:
QCad Pro
Linux MX-23.5_KDE_x64 Libretto

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: 3.27.9 question about (images relative path) solved

Post by CVH » Sun Jan 22, 2023 8:03 pm

bambuko wrote:
Sat Jan 21, 2023 1:07 pm
because QCAD does not store inserted image as part of .dxf file,
Indeed, QCAD does not, I didn't said otherwise and I don't see that as a disadvantage.

Under ACAD they can store bitmaps in a dwg/dxf but the biggest downside I see is the used BMP format.
All in the provided links: A 659KB picture in a 160KB drawing returns a 5.7MB file.
bambuko wrote:
Sun Jan 22, 2023 1:33 pm
I do not use .bmp precisely because of file size.
In the above case I suspect the 659KB picture is of a compressed format type like jpg. :roll:

Concerning 'Screenshot from 2023-01-22 12.30.00.jpeg'
CVH wrote:
Sat Jan 21, 2023 12:38 pm
The solution for you is storing a relative path ... The dxf file path or only the file name.
QCAD will then only look for it in the drawing path.
All seems to be fine now and I hope your confusing is solved too. :wink:


Time for a little tool that removes the absolute path of bitmap entities? :P

Regards,
CVH

User avatar
bambuko
Premier Member
Posts: 192
Joined: Fri Jul 02, 2021 6:20 pm
Location: UK, England, North Devon

Re: 3.27.9 question about (images relative path) solved

Post by bambuko » Sun Jan 22, 2023 8:38 pm

Thank you,
Sometimes it's good to compare the notes :mrgreen:
QCad Pro
Linux MX-23.5_KDE_x64 Libretto

iOne iTwo
Active Member
Posts: 37
Joined: Thu Oct 26, 2023 5:50 pm

Re: 3.27.9 question about (images relative path) solved

Post by iOne iTwo » Thu Jun 12, 2025 12:25 pm

Is quad on Windows *always* looking in the local path?

I deliberately changed the absolute path to the wrong file,
and the image still worked. I then changed the local filename, and it broken,
and then edited the incorrect absolute path with the proper local name,
and the image returned.

c:\Users\me\Dropbox\file x.jpg - works
q:\Userz\xx\Dropbox\file x.jpg - works


Version:
3.32.3.0 (3.32.3)
Internet:
QCAD.org
Build Date:
Jun 2 2025
Revision:
b079d79
Qt Version:
5.13.2
Architecture:
x86_64
Compiler:
MSVC++ 14.0 (2015)

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: 3.27.9 question about (images relative path) solved

Post by CVH » Thu Jun 12, 2025 3:19 pm

@ iOne iTwo

Above reply by Andrew:
andrew wrote:
Fri Jan 20, 2023 8:46 pm
QCAD looks up images from the absolute (or relative) path as stored in the DXF. If the image is not found there, it resorts to the same folder where the DXF is stored.
So yes, when not found as stored in the reference, QCAD will scan the folder of the drawing file for the filename (without path).
If found in the drawing path it will use that picture, otherwise the representation in QCAD turns empty because the source can not be loctated.
iOne iTwo wrote:
Thu Jun 12, 2025 12:25 pm
I deliberately changed the absolute path to the wrong file, and the image still worked.
I think you mean changing the absolute path but keeping the original filename 'abc.jpg'.
If 'abc.jpg' is in the same folder as your drawing file that is indeed intended to work as explained above.
But if it is not, then QCAD can not locate it in the faulty path or in the drawing folder.

If a drawing refers to 'abc.jpg' and you rename the bitmap file to 'xyz.jpg' outside QCAD then 'abc.jpg' doesn't exist any longer.
Then QCAD can not locate the renamed file 'abc.jpg' anywhere and the representation in QCAD turns empty when the screen is updated.
Screen updates happen on almost any event that changes something.

If a reference to a bitmap is incorrectly stored then QCAD renders nothing but the Bitmap entity still exist.
Filling in the correct reference in the Property Editor would update the screen and show the intended picture.

Regards,
CVH

iOne iTwo
Active Member
Posts: 37
Joined: Thu Oct 26, 2023 5:50 pm

Re: 3.27.9 question about (images relative path) solved

Post by iOne iTwo » Sat Aug 09, 2025 8:04 pm

If a reference to a bitmap is incorrectly stored then QCAD renders nothing but the Bitmap entity still exist.
Filling in the correct reference in the Property Editor would update the screen and show the intended picture.
Suggestion to make this more robust:
Have qcad write to the console between "Opening drawing" and "Drawing loaded successfully"
the path name of any image that failed to load.


Once an image fails to load, it also is more or less invisible in the interface.
Thanks to your tip I was able to use the property editor ("GP") and select type ("image") and find and fix the reference.
But it was pretty opaque.

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: 3.27.9 question about (images relative path) solved

Post by CVH » Sun Aug 10, 2025 3:45 am

Hi,
iOne iTwo wrote:
Sat Aug 09, 2025 8:04 pm
Suggestion to make this more robust ...
Yes, a short warning should be in order. :wink:
Other options are rendering a blank area or an empty border, perhaps crossed out.

Suggestions are best filed at QCAD Bugtracker
iOne iTwo wrote:
Sat Aug 09, 2025 8:04 pm
But it was pretty opaque.
The original 'Fade' factor is stored along with the other properties:
  • Angle, File (link), Width (factor), Height (factor) and Position.
When 'pretty opaque' after the path fix then it was originally stored like that.
iOne iTwo wrote:
Sat Aug 09, 2025 8:04 pm
I was able to use the property editor ("GP") and select type ("image") ...
In my case at least the Property Editor is always showing.
After selecting all (TA) it may indeed list 'Image [n]' in the selection drop-down.
But with more than one image you would not be able to diversify between them.

With only one or only one of many is missing:
Display the Selection Filter (GF): Type = Image ; Property = Size : Width ; Comparison = Equal to ; Value = Zero.
Then hitting the first button ('Replace the current selection') will select those that have no visible width.
This is a calculated value based on the stored Width factor times the retrieved and actual width of the bitmap file.

I have no real solution for more than one missing image.

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”