Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

encode and decode advice please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    encode and decode advice please

    I have tried encoding and decoding both JPG and JPEG fields, and get jumbled characters as the actual file name.

    Example;

    C:\myfolder\myimages\!"$%%!

    How can I get the file name to display correctly as,

    C:\myfolder\myimages\Image 101.jpg
    See our Hybrid Option here;
    https://hybridapps.example-software.com/


    Apologies to anyone I haven't managed to upset yet.
    You are held in a queue and I will get to you soon.

    #2
    Re: encode and decode advice please.

    Is this in a form? Exactly was the image field populated? Does it display OK? Is the image path in the same as, or a sub of, the ADB path or outside it?
    Finian

    Comment


      #3
      Re: encode and decode advice please.

      Originally posted by Finian Lennon View Post
      Is this in a form? Exactly was the image field populated? Does it display OK? Is the image path in the same as, or a sub of, the ADB path or outside it?
      On a Form. Populated by client selection from an image in a folder on a different drive. Displays ok.

      See screen shot belowAlpha Capture.JPG
      Last edited by Ted Giles; 01-22-2019, 04:36 AM.
      See our Hybrid Option here;
      https://hybridapps.example-software.com/


      Apologies to anyone I haven't managed to upset yet.
      You are held in a queue and I will get to you soon.

      Comment


        #4
        Re: encode and decode advice please.

        I'm guessing that the form has a typo in the code for image_2 i.e. filename_decode(Image1). Also, I'm guessing that each image is in its own IRF field. I'm also guessing that the two text fields have identical properties (width and formatting the same) then I'm not sure what is going on.

        What I would look at first is how the image name was written into the field to be sure that nothing odd is going on. If you right click on Image_2, what values show when you "Show the filename" ? The same as in your text box?
        Finian

        Comment


          #5
          Re: encode and decode advice please

          Thanks Finian.
          The typo was in the text. The actual decode was for Image2.

          Right click on the IRF field shows an option to "Show Image Filename". That appears just as in the text box.

          Right click on a JPEG field (Image 2) - which shows the image exactly as the one above in the IRF field - and the options are completely different.
          I am offered Import, Export, Delete etc.

          From this I must presume that there is some sort of link for a JPEG field which is unlike the link for an image in an IRF.
          Both field types end up as Memo fields, so I am stumped as to what might be a workaround.
          The data must be stored somewhere in the JPEG Memo field, but how to get at it!
          See our Hybrid Option here;
          https://hybridapps.example-software.com/


          Apologies to anyone I haven't managed to upset yet.
          You are held in a queue and I will get to you soon.

          Comment


            #6
            Re: encode and decode advice please

            Sorry, I haven't been paying close enough attention, and need to make a somewhat embarrassing confession: up until last week, I think, I was not even aware of the existence of the JPG field type. My sad excuse is that I started with Alpha at a time when the IRF field was the only option for displaying images in forms or browses. Some wiseacre will probably point out that the JPG field has been around FOREVER, but I don't care, and for the following reasons (1) having now looked at the description and played, albeit very briefly, with the JPG field type, I can see no reason to ever use it and (2) as I have said elsewhere, I no longer use the the IRF field type either. They exist in my main application but only for legacy reasons and too many processes exist that rely on their existence, so taking them out is way too much trouble.

            I will say that we make what I consider to be extensive use of images in the application. Every ticket we create requires us to save the following images to our header table: (1) a driver's license, a signature, a fingerprint, a picture of the customer and an image of a special ID card that is required. In addition we save an image for every line of every ticket. We have a total of something like 750,000 images stored currently.

            So our header table has 5 images stored and displayed on the ticket form for every ticket. For several months last Spring, when we were still using IRF fields for display, every day was nightmare because, when there were three or more users in the system, images disappeared completely or were displayed in the wrong place, the DL where the signature should be or the customer picture where the fingerprint should be etc. I tried everything I could think of but got nowhere until, at Tom Henkel's suggestion, I removed the IFR fields from the form and replaced them with form Bitmap objects. Once I did that, there has never been another occurrence of the messed up display. We were populating the IFR fields in the OnFetch event anyway, so the biggest task I had was to rewrite the OnFetch code to populate the bitmap objects.

            If I was handing out gratuitous advise, which I suppose I am, it would be this: never use IFR fields for display of images on forms, only use Bitmap Objects and name your image files in a way that they can be retrieved in the OnFetch event of any form or browse that needs to display them. Or use xDialogs to display them.

            Oh, and don't get me started on the instability of the entire fpt file structure. I ended up, a number of years ago, writing a function to remove, then recreate the fpt file and repopulate the image fields, as part of the nightly maintenance process. When your main table data input crashes because of a blown memo field, you will do everything that you can to prevent it.

            As to your particular issue, I'm curious, why use the JPG field at all? Why not another IFR field (OK, contradictory advice but ....) or, as I suggested use Bitmap controls. Then all you need is the full path and file name saved in a text field to be able to display the image.
            Finian

            Comment


              #7
              Re: encode and decode advice please

              I will look at the use of bit maps Finian, but I still need to be able to identify the drive, folder and file name after the user selects the image. All images come in as jpg so as I said, I will test using them in a bitmap defined field.
              Thanks for the thorough explanation.

              Edit.
              Nope, when a .bmp is selected and placed in a bitmap defined field, decode still shows spurious characters in the path name.
              Last edited by Ted Giles; 01-23-2019, 05:36 AM.
              See our Hybrid Option here;
              https://hybridapps.example-software.com/


              Apologies to anyone I haven't managed to upset yet.
              You are held in a queue and I will get to you soon.

              Comment


                #8
                Re: encode and decode advice please

                I'm having a hard time visualizing the steps. How is the user selecting the image? How is that being inserted into Alpha. Is the image tied to a record in some way and named accordingly? Are the images in many different locations? Why not add a text field to the table, populate both the image field and text field at the same time, and use the text field as the file name display source.

                Since the IRF file name displays correctly is it possible that there's a particular Alpha issue with the JPG field type and why the JPG field type in the first place? What is the advantage? And, ultimately, if you use a bitmap control, and retrieve the full path file name from the text field, you have all that you need to display the image using some simple code in the form OnFetch event. Just a thought.
                Finian

                Comment


                  #9
                  Re: encode and decode advice please

                  The attached may explain things better than I can in text Finian.
                  I wish I could extrapolate the image path for a bitmap, but I cannot. If you have some way of doing it I would be jumping for joy!
                  Attached Files
                  See our Hybrid Option here;
                  https://hybridapps.example-software.com/


                  Apologies to anyone I haven't managed to upset yet.
                  You are held in a queue and I will get to you soon.

                  Comment


                    #10
                    Re: encode and decode advice please

                    Ted:

                    As far as I can see, you are correct. There appears to be no way to extract the file name from the JPG and Bitmap fields. If you look in the object explorer, you will see that it reports the spurious file name for JPG and Bitmap fields, whereas it reports the filename correctly for IRF fields.

                    Did you notice that when you select the JPG field it embeds the image in the table? Now I know why I would never use them! The fpt file will be enormous/unmanageable in no time if you use either the jpg or bitmap field types. The IRF file contains only a reference to the image and not the image itself, so it doesn't affect file size in the same way.

                    In my earlier messages I was referring to the form bitmap image type, not the table bitmap type. I added a form bitmap control and path field to the table and in the return zip I have a button to populate that form field in much the same way that the built-in control does for the table field types. When you use this, you need the OnFetch code to show the image based on the saved value in the path field. Note, that if you choose this method, you could, if you wanted, get rid of the table image field completely and just use the path field and the form bitmap field to display it.

                    So, I think your only alternatives are the IRF field and/or the form bitmap control but you should be able to do what you need with those.
                    Attached Files
                    Finian

                    Comment


                      #11
                      Re: encode and decode advice please

                      Thanks for putting up with my ramblings Finian.
                      I will explore the very sensible option you suggest.
                      Much appreciated.

                      Edit.
                      Tried this and it is a great approach!
                      It may overcome the potential issues with Memo fields and corruption.
                      Last edited by Ted Giles; 01-24-2019, 07:47 AM.
                      See our Hybrid Option here;
                      https://hybridapps.example-software.com/


                      Apologies to anyone I haven't managed to upset yet.
                      You are held in a queue and I will get to you soon.

                      Comment

                      Working...
                      X