another strange one

36 views
Skip to first unread message

r...@amalasoft.com

unread,
Apr 22, 2019, 7:10:04 PM4/22/19
to Eiffel Users Group
Hi All
I dusted off a feature I haven't used in, ..  Never mind how long it's been.
With 18.07, I tried saving a pixmap to a file using

EV_PIXMAP.save_to_named_file (fmt, fname)
Where: fmt was an instance of EV_PNG_FORMAT and fname was the ever-adventurous "test.png"

The save_to_named_file routine calls upon PATH.make_from_string and that gets a CAT call.
My guess is it has little or nothing to do with pixmaps, and a lot to do with the UTF conversion cited in the CAT call.
This is what it said:
Catcall detected in {UTF_CONVERTER}.utf_16le_string_8_to_escaped_string_32 for arg#1: expected READABLE_STRING_8 but got Void

R

r...@amalasoft.com

unread,
Apr 23, 2019, 7:16:12 AM4/23/19
to Eiffel Users Group
Hi
I just tried the save_to_named_path equivalent and did not see the problem.
R
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/eiffel-users.
For more options, visit https://groups.google.com/d/optout.

r...@amalasoft.com

unread,
Apr 23, 2019, 7:57:34 AM4/23/19
to Eiffel Users Group
Not so fast.
While it's true, I did not see the CAT call when using save_to_named_path, I still failed to accomplish my objective.
The issue is not related to the CAT call at all.
I am attempting to create a simple image in a drawing area.  So far, easy as pie.
Then, I'm attempting to save the image from the drawing area to a file.
While I can save something to a file, it's not the image from the drawing area.
I have tried a couple of things.
First, I tried to create a pixmap by using the sub_pixmap function from EV_DRAWABLE, providing it a rectangle that has an origin of 0, 0 and dimensions the same as the drawing area.
That produces a pixmap of 0x0 pixels.
Undaunted (or maybe a little daunted), I tried the usually more reliable EV_PIXEL_BUFFER as a medium, creating the pixel buffer from the sub_pixmap, then converting the pixel buffer to a pixmap for saving to file.  This resulted in a pixmap of the correct dimensions, but devoid of content.
I'm out of guesses.
Any suggestions?
Thanks

Alexander Kogtenkov

unread,
Apr 23, 2019, 9:11:06 AM4/23/19
to eiffel...@googlegroups.com
The issue seems to be quite specific. For example, EiffelStudio uses EV_PIXMAP.save_to_named_path to export a diagram to the PNG format. It opens the target file for writing to check that this can be done, then it closes the file, and, finally, it calls `save_to_named_path (create {EV_PNG_FORMAT}, path)`. Therefore, it would be nice to report the issue with a reproducible example at the support site. As of now, it's unclear what could be wrong.

Regards,
Alexander Kogtenkov


 r...@amalasoft.com:

r...@amalasoft.com

unread,
Apr 23, 2019, 10:50:18 AM4/23/19
to eiffel...@googlegroups.com
The problem is indeed quite specific, you're correct.
I did some testing and I can save pretty much any EV_PIXMAP I choose, using the save_to_named_path and it works like a charm.
There remains a CAT call problem when using save_to_named_file, having nothing to do with pixmaps, I suspect, but having to do with character set conversion, as the CAT call message seems to imply.

The second issue is not with saving a known pixmap, but in capturing, as a save-able pixmap, the contents of an EV_DRAWING_AREA.  The sub_pixmap function does not seem to do the job, resulting in an empty pixmap.  I did not find any other functions that would do the job.

BTW, to work around the drawing area problem, I created a scratch pixmap on which I draw everything that I would in the drawing area.  It's a very heavy-handed work-around, but it gets the job done.

I'll report each issue separately.  Thanks.

javier hector

unread,
May 17, 2019, 10:12:31 AM5/17/19
to Eiffel Users
Hi Roger, if you can submit a bug report to support site with a simple example reproducing the issue it would be bice.
/Javier
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users+unsubscribe@googlegroups.com.



--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages