Loading ...
Sorry, an error occurred while loading the content.

Opening jpg images in Eiffel 6

Expand Messages
  • Don
    Hello Eiffel experts, after only attempting very trivial tasks in Eiffel previously, I ve decided the best way to learn Eiffel is to try something a little
    Message 1 of 7 , Apr 1, 2007
    • 0 Attachment
      Hello Eiffel experts,
      after only attempting very trivial tasks in Eiffel previously, I've decided
      the best way to learn Eiffel is to try something a little more substantial.
      The first step in my project is to write a Vision2 app that is able to open
      and view a .jpg file. Second I'd like to be able to clip it then save the
      .jpg file and third I'd like to be able to view the exif info. Further steps
      will be dependent on me getting this far ;)
      Looking through EiffelMedia I see that some of the examples load .jpg files,
      for example lovely loads matterhorn.jpg as a background image. However, the
      EiffelMedia 0.9 examples don't work with the version of EiffelStudio I have
      installed (EiffelStudio 6 (6.0.6.7183 GPL Edition)). I get the following
      message when I try to compile:
      Error code: VYCQ(2)
      Error: current class conforms to target of conversion query.
      What to do: make sure current class does not conform to target of
      conversion query or remove the target from the type list.

      Class: EM_VECTOR4F
      Feature name: to_reference
      Conversion type: EM_VECTOR4F_REF

      I see four options:
      1) Go back to using an older version of Eiffel
      2) Wait until I can get EiffelMedia working with ES6 (not sure if this is my
      problem or a result of ES 6 implementing new language concepts).
      3) Find another library function to convert .jpgs into pixmaps
      4) Write my own functions to load and save .jpgs

      Any advice appreciated.

      Thanks
    • rfo@amalasoft.com
      Hello Don! This is actually not a problem with 6.0 per se (i.e. it s not an EiffelStudio bug). And don t bother back-reving, as the same issue existed with
      Message 2 of 7 , Apr 1, 2007
      • 0 Attachment
        Hello Don!

        This is actually not a problem with 6.0 per se (i.e. it's not an EiffelStudio bug). And don't bother back-reving, as the same issue existed with 5.7.
        The problem is that this explicit conversion is no longer needed and in fact has become illegal, hence the error.

        The fix is very simple indeed.
        In your em_vector4f.e file, simply comment out or remove the offending code (it didn't used to be offending, and I mean nothing negative by using the expression), as in:

        --RFO to_reference: {EM_VECTOR4F_REF,
        --RFO ANY},

        You will find a handful of such files, and the same fix works for all.

        Best regards,

        R

        ==================================================
        Roger F. Osmond
        ----------------------------------------
        Amalasoft Corporation
        273 Harwood Avenue
        Littleton, MA 01460


        > -------- Original Message --------
        > Subject: [eiffel_software] Opening jpg images in Eiffel 6
        > From: Don <cooped02@...>
        > Date: Sun, April 01, 2007 3:31 am
        > To: eiffel_software@yahoogroups.com
        >
        > Hello Eiffel experts,
        > after only attempting very trivial tasks in Eiffel previously, I've
        > decided
        > the best way to learn Eiffel is to try something a little more
        > substantial.
        > The first step in my project is to write a Vision2 app that is able to
        > open
        > and view a .jpg file. Second I'd like to be able to clip it then save the
        > .jpg file and third I'd like to be able to view the exif info. Further
        > steps
        > will be dependent on me getting this far ;)
        > Looking through EiffelMedia I see that some of the examples load .jpg
        > files,
        > for example lovely loads matterhorn.jpg as a background image.
        > However, the
        > EiffelMedia 0.9 examples don't work with the version of EiffelStudio I
        > have
        > installed (EiffelStudio 6 (6.0.6.7183 GPL Edition)). I get the following
        > message when I try to compile:
        > Error code: VYCQ(2)
        > Error: current class conforms to target of conversion query.
        > What to do: make sure current class does not conform to target of
        > conversion query or remove the target from the type list.
        >
        > Class: EM_VECTOR4F
        > Feature name: to_reference
        > Conversion type: EM_VECTOR4F_REF
        >
        > I see four options:
        > 1) Go back to using an older version of Eiffel
        > 2) Wait until I can get EiffelMedia working with ES6 (not sure if this
        > is my
        > problem or a result of ES 6 implementing new language concepts).
        > 3) Find another library function to convert .jpgs into pixmaps
        > 4) Write my own functions to load and save .jpgs
        >
        > Any advice appreciated.
        >
        > Thanks
      • rfo@amalasoft.com
        Hello Again! I just re-read your posting and I see a worrisome combination. You want to build a Vision app, but you are using the eiffelmedia library. This
        Message 3 of 7 , Apr 1, 2007
        • 0 Attachment
          Hello Again!

          I just re-read your posting and I see a worrisome combination. You want to build a Vision app, but you are using the eiffelmedia library. This is certainly possible, but not for the faint of heart. eiffelmedia applications have their own main event loop, as do EiffelVision applications. Once you launch the eiffelmedia application, you are pretty much out of the EiffelVision business. You might not have realized this.
          For the application you describe, the combination might actually work, but you will have to be careful. Perhaps some of the eiffelmedia experts out there can advise as to the best method by which to use the jpg support in eiffelmedia, without instantiating an eiffelmedia application (with its main event loop). If that can be accomplished, then you will indeed have a vision2 application and you can have all sorts of fun with it - and have predictable behavior. If not, you will effectively have an eiffelmedia application inside a vision2 main window. That is far less satisfying.
          This is not intended as a knock on eiffelmedia, by the way. It's an impressive body of work. The issue is only with the interaction between the two rather different libraries. I would hope someday in the future, we might be able to meld them better, perhaps adopting the eiffelmedia event handling into vision2. I think this would benefit Windows apps especially, as timing is more controllable and predictable with eiffelmedia than with Win32.

          Best regards,
          R

          ==================================================
          Roger F. Osmond
          ----------------------------------------
          Amalasoft Corporation
          273 Harwood Avenue
          Littleton, MA 01460


          > -------- Original Message --------
          > Subject: [eiffel_software] Opening jpg images in Eiffel 6
          > From: Don <cooped02@...>
          > Date: Sun, April 01, 2007 3:31 am
          > To: eiffel_software@yahoogroups.com
          >
          > Hello Eiffel experts,
          > after only attempting very trivial tasks in Eiffel previously, I've
          > decided
          > the best way to learn Eiffel is to try something a little more
          > substantial.
          > The first step in my project is to write a Vision2 app that is able to
          > open
          > and view a .jpg file. Second I'd like to be able to clip it then save the
          > .jpg file and third I'd like to be able to view the exif info. Further
          > steps
          > will be dependent on me getting this far ;)
          > Looking through EiffelMedia I see that some of the examples load .jpg
          > files,
          > for example lovely loads matterhorn.jpg as a background image.
          > However, the
          > EiffelMedia 0.9 examples don't work with the version of EiffelStudio I
          > have
          > installed (EiffelStudio 6 (6.0.6.7183 GPL Edition)). I get the following
          > message when I try to compile:
          > Error code: VYCQ(2)
          > Error: current class conforms to target of conversion query.
          > What to do: make sure current class does not conform to target of
          > conversion query or remove the target from the type list.
          >
          > Class: EM_VECTOR4F
          > Feature name: to_reference
          > Conversion type: EM_VECTOR4F_REF
          >
          > I see four options:
          > 1) Go back to using an older version of Eiffel
          > 2) Wait until I can get EiffelMedia working with ES6 (not sure if this
          > is my
          > problem or a result of ES 6 implementing new language concepts).
          > 3) Find another library function to convert .jpgs into pixmaps
          > 4) Write my own functions to load and save .jpgs
          >
          > Any advice appreciated.
          >
          > Thanks
        • Emmanuel Stapf [ES]
          ... Using EV_PIXEL_BUFFER you can actually load a .jpg on both Unix and Windows. That might help you however it does not extract the meta information in it.
          Message 4 of 7 , Apr 1, 2007
          • 0 Attachment
            > The first step in my project is to write a Vision2 app that
            > is able to open and view a .jpg file. Second I'd like to be

            Using EV_PIXEL_BUFFER you can actually load a .jpg on both Unix and Windows.
            That might help you however it does not extract the meta information in it.

            Regards,
            Manu
          • Alex Rice
            I am pretty sure there is a vision2 canvas-widget in eiffelmedia which would bridge the gap. i can t remember the class name though. Alex
            Message 5 of 7 , Apr 1, 2007
            • 0 Attachment
              I am pretty sure there is a vision2 canvas-widget in eiffelmedia which
              would bridge the gap. i can't remember the class name though.

              Alex

              On 4/1/07, rfo@... <rfo@...> wrote:
              > Hello Again!
              >
              > I just re-read your posting and I see a worrisome combination. You want to build a Vision app, but you are using the eiffelmedia library. This is certainly possible, but not for the faint of heart. eiffelmedia applications have their own main event loop, as do EiffelVision applications. Once you launch the eiffelmedia application, you are pretty much out of the EiffelVision business. You might not have realized this.
              > For the application you describe, the combination might actually work, but you will have to be careful. Perhaps some of the eiffelmedia experts out there can advise as to the best method by which to use the jpg support in eiffelmedia, without instantiating an eiffelmedia application (with its main event loop). If that can be accomplished, then you will indeed have a vision2 application and you can have all sorts of fun with it - and have predictable behavior. If not, you will effectively have an eiffelmedia application inside a vision2 main window. That is far less satisfying.
              > This is not intended as a knock on eiffelmedia, by the way. It's an impressive body of work. The issue is only with the interaction between the two rather different libraries. I would hope someday in the future, we might be able to meld them better, perhaps adopting the eiffelmedia event handling into vision2. I think this would benefit Windows apps especially, as timing is more controllable and predictable with eiffelmedia than with Win32.
              >
              > Best regards,
              > R
              >
            • Peter Gummer
              ... EM_EV_WIDGET? - Peter Gummer
              Message 6 of 7 , Apr 1, 2007
              • 0 Attachment
                Alex Rice wrote:
                >I am pretty sure there is a vision2 canvas-widget in eiffelmedia which
                > would bridge the gap. i can't remember the class name though.

                EM_EV_WIDGET?

                - Peter Gummer
              • cooped
                Thanks for all of the replies. From what I understand: 1) trying to use EiffelMedia and Vision2 combined will require more advanced skills than I have at the
                Message 7 of 7 , Apr 2, 2007
                • 0 Attachment
                  Thanks for all of the replies.

                  From what I understand:
                  1) trying to use EiffelMedia and Vision2 combined will require more advanced
                  skills than I have at the moment. I had already tried the deleting of
                  to_reference: {EM_VECTOR4F_REF, ANY}, but the C compilation failed. I
                  thought because of my deletions but perhaps something is not quite set up
                  right. After trying again I notice the failure is in the linking, so my
                  setup is probably the culprit.
                  2) I don't need to use EiffelMedia because I can use EV_PIXEL_BUFFER to load
                  the image from a .jpg file. I thought the exif data would be something I
                  have to work through myself.
                  3) I should look at EM_EV_WIDGET.


                  --
                  View this message in context: http://www.nabble.com/Opening-jpg-images-in-Eiffel-6-tf3500279s16963.html#a9790197
                  Sent from the Eiffel Software Users mailing list archive at Nabble.com.
                Your message has been successfully submitted and would be delivered to recipients shortly.