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

Multiple image import

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

    Multiple image import

    Is there a way to will import 100's or even 1000's of images into an image field easily without having to import each one individually?
    Kevin G. Timberlake
    Marvel Illusions

    #2
    Re: Multiple image import

    Not understood. One each of thousands of images into thousands of records? Jpeg field or image file reference field? How would you know which image went with which record?
    There can be only one.

    Comment


      #3
      Re: Multiple image import

      The images are jpeg, the form has 2 fields
      1) Image
      2) ID Number (auto increment)
      I want to take a folder with tons of jpeg's in it and import them all into an image database. Each record is an image holder.
      Kevin G. Timberlake
      Marvel Illusions

      Comment


        #4
        Re: Multiple image import

        You can only have one image per record but this post by Richard explains it well: http://msgboard.alphasoftware.com/al...ghlight=images

        Comment


          #5
          Re: Multiple image import

          The message below deals with placing a button on a form which would get a named jpeg and store it in a jpeg field shown on the form. It shouldn't be too hard to adapt to process a whole table.


          Msg ID: 14790
          Subject: RE: Adding Jpeg to DB via button
          Author: Selwyn Rabins
          Date: 12-17-2002 9:55 PM
          File:


          Don't know exactly what you want to do, or how comfortable you are with Xbasic, but I will show you here what code gets executed when you right click on a Bitmap or Jpeg field and select the command to import an image into the field. Seeing this code will allow you to write any kind of customized routine you want to import images into Bitmap or Jpeg fields.

          You might also want to consider using Image File Reference fields. These fields only store the image filename (not the image itself). The benefit of this is that the database remains small. It is very easy using Xbasic to set the image file reference field to the filename of the image field.



          This is the code to insert a jpeg image. You pass in a pointer to the image field on the form. For example, if you have a jpeg field on the form and the Object name of the field on the form (see Name property in the field properties dialog) is jpeg1 then you would call this function with this command:

          a5_get_jpeg(jpeg1.this)

          function a5_get_jpeg as v(obj as p)
          result = ui_get_image_filename("")
          if result "" then
          dim data as b
          f = file.open(result,FILE_RO_SHARED)
          data = f.readb(f.bytes_get())
          f.close()
          if right(result,4) = ".BMP" then
          data = bitmap_to_jpeg(data)
          end if
          fld = obj.field_get()
          tbl = fld.table_get()
          if tbl.mode_get() = 0 then
          tbl.change_begin()
          fld.value_put(data)
          tbl.change_end(.t.)
          obj.parent.Resynch()
          else
          fld.value_put(data)
          obj.parent.commit()
          obj.parent.Resynch()
          end if
          end if
          end function
          There can be only one.

          Comment


            #6
            Re: Multiple image import

            What I am doing is making a database to "store" the images. I realize the database will end up being very large with time, but it allows the exchange of images. This is so I and the developer I am working with can easily share our images rather than a zip which would mean we would have to explore each image. This database would allow the searching of an image much easier. So Image Reference would not work.

            Thanks Stan, I will mess with this code and see what I can make. I am not real good with xbasic, but am learning....slowly..LOL
            Kevin G. Timberlake
            Marvel Illusions

            Comment


              #7
              Re: Multiple image import

              Code:
              dim img as C
              dim tbl as P
              list = filefind.get("[COLOR="red"]c:\temp\covers\[/COLOR]*.jpg",FILE_FIND_NORMAL,"PN")'use your jpeg directory
              tbl = table.open("[COLOR="red"]test[/COLOR]")'use your table name
              for i = 1 to w_count(list,crlf())
              	tbl.enter_begin(.t.)
              	tbl.[COLOR="Red"]Pic[/COLOR].memo_read_from_file(word(list,i,crlf()), MEMO_APPEND)'use your jpeg field name
              	tbl.enter_end(.t.)
              next
              
              tbl.close()
              Last edited by Stan Mathews; 12-22-2008, 03:40 PM.
              There can be only one.

              Comment


                #8
                Re: Multiple image import

                Thanks Stan. I did this:
                Code:
                dim img as C
                dim tbl as P
                list = filefind.get("[COLOR="Red"]I:\IconPack\ScrapIcons\PNG\*.png[/COLOR]",FILE_FIND_NORMAL,"PN")'use your jpeg directory
                tbl = table.open("[COLOR="Red"]images[/COLOR]")'use your table name
                for i = 1 to w_count(list,crlf())
                	tbl.enter_begin(.t.)
                	tbl.[COLOR="Red"]Name[/COLOR].memo_read_from_file(word(list,i,crlf()), MEMO_APPEND)'use your jpeg field name
                	tbl.enter_end(.t.)
                next
                
                tbl.close()
                And although it creates the records, it does not "insert the images" into the jpeg1 field or the image file name into the Name field. What am I missing?
                Kevin G. Timberlake
                Marvel Illusions

                Comment


                  #9
                  Re: Multiple image import

                  Duh, "Name" should be jpeg1...
                  Kevin G. Timberlake
                  Marvel Illusions

                  Comment


                    #10
                    Re: Multiple image import

                    1) Image
                    2) ID Number (auto increment)
                    I don't see a name field. If you want to store the name as well in a field named Name......

                    Code:
                    dim img as C
                    dim tbl as P
                    list = filefind.get("I:\IconPack\ScrapIcons\PNG\*.png",FILE_FIND_NORMAL,"PN")
                    names = filefind.get("I:\IconPack\ScrapIcons\PNG\*.png",FILE_FIND_NORMAL,"N")
                    tbl = table.open("images")
                    for i = 1 to w_count(list,crlf())
                    	tbl.enter_begin(.t.)
                            tbl.Name = word(names,i,crlf())
                    	tbl.Jpeg1.memo_read_from_file(word(list,i,crlf()), MEMO_APPEND)
                    	tbl.enter_end(.t.)
                    next
                    
                    tbl.close()
                    There can be only one.

                    Comment


                      #11
                      Re: Multiple image import

                      Hi there everybody
                      I am new to alpha 5 V9 [and V10] and am struggling with the x basic ideas in this post, so can anyone help to explain in a very simple way please?

                      I have a number of related tables with an Image File Reference field inserted in my V9 application. I have a total of some 15,000 individual images to import the IFR for so I can construct reports based on those tables which will show the correct image for each entry. The images are all named "Image_Partnumber" where "Partnumber" is the relevant image for each part in the table i.e V1000 has the image named "Image_V1000", V1001 has "Image_V1001" etc. I have tried to adapt the x basic as per the link to the post by Selwyn Rabins further down in this thread but keep getting an error message for line 46 column 1 which is
                      "imageName = Images + chr(92) +\". Please can somebody explain where I am going wrong and / or a simple way to import these image links. I am also developing a web application that requires these images to show on a web grid, would the same or similar coding apply or do I need pointing elsewhere in the forum please.

                      Comment


                        #12
                        Re: Multiple image import

                        I can't find the code from Selwyn that you reference. Can you post the whole code for your script?
                        There can be only one.

                        Comment


                          #13
                          Re: Multiple image import

                          Originally posted by Stan Mathews View Post
                          I can't find the code from Selwyn that you reference. Can you post the whole code for your script?
                          Is this the one? http://msgboard.alphasoftware.com/al...ghlight=images

                          It was Richard who posted it in another thread

                          Comment


                            #14
                            Re: Multiple image import

                            The backslash at the end of that line is a continuation character. the whole line is

                            Code:
                            imageName = imageFolderName + chr(92) +evaluate_string(image_filename_template)
                            The backslash was likely used to make the code visible in a normal editing window. Copying and pasting from this message board seems to add a blank line. You can use what I posted above or just remove the blank line.

                            imageName = imageFolderName + chr(92) +\
                            evaluate_string(image_filename_template)
                            There can be only one.

                            Comment


                              #15
                              Re: Multiple image import

                              So sorry [and extremely stupid!!!] of me to ask for help and then not even get the reference right!!!. It is of course RICHARD RABINS not Selwyn who's script I was struggling with, which is correctly identified by NoeticCC. Thanks ever so much for the amazingly prompt reply chaps, I will try that code line and let you know how I fare.

                              Bryan

                              Comment

                              Working...
                              X