Archive for the ‘ImageCloud’ category

Imagecloud GUI update

February 26, 2007

I’ve been pretty busy with school, so I haven’t had much time to update this beast. I’ve gotten http://71.201.65.239/projects/imagecloud/images/screens/2007.02.25.png done though. That’s my personal server, so if it goes down, you know why. I’ve also moved over to a Debian Etch install, and it’s sweet

kristofer

C is in

February 8, 2007

I’ve been working on IC in C (that’s kinda’ fun to say in the “J2 in the ER” way*). I did a paste, it’s at [dead paste] , but it’s only good for 24hrs, so it might not be there when you click. Otherwise, check: http://71.201.65.239/projects/imagecloud/ . No, the site isn’t finished either.

*See “Lucy, Daughter of the Devil” from Adult Swim or http://www.youtube.com/watch?v=SdbP0rEtPrQ

Put that pointer away!

December 3, 2006

I’ve been working on imagecloud more, and listening to my sister tell me how it needs a gui for mass appeal. I don’t disagree, but I am the LAST person one wants designing one of those. Think… http://www.codinghorror.com/blog/images/wgetgui-screenshot.png . Don’t get me wrong, I love wget, but I don’t know that the average user loves that UI. Anyway, my sister is sketching what a sane UI would work like for me. Back in the code, where I actually work, I realized I don’t need that pointer for Glob() to return if I used a variable parameter instead of value and make it a procedure. Much simpler to work with then. I’m almost finished. I just need to complete the searching through the tags portion, and mayble look into what other libraries are available to it for graphic displaying (read : Thumbnails).

ImageCloud Update

December 1, 2006

My Pascal version of ImageCloud is coming along decently. I couldn’t return an StrArray for some reason (fpc kept failing to compile) so rather than figure out the problem, I used a pointer instead. Seemed simpler.

program ImageCloud( input, output, TagDB );


uses

  DOS; {to enable findfirst and findnext}

const

  MAXDBSIZE = 224; {max number of cells to the array}

type

  StrArray = Array [0..(MAXDBSIZE-1)] of String; {define type for array}

  FileTypes = (JPG, GIF, PNG);

  StrAryPtr = ^StrArray;

var

  TagDB : Text; {Declare database file for tags and filenames}



function Glob(pathname : String) : StrArray;

  var

    listing : StrArray;

    listptr : StrAryPtr;

    s : SearchRec; {variable to store the found file in}

    i : Integer; {counter variable for loops}

  begin

    i := 1; 

    listing[0] := ' '; {set the first cell of the filelist to a blank space for loop termination check}

    findfirst(pathname + '*.*', AnyFile, s); {find first file in provided directory}

    if s.name <> '' then {if the name is not blank, that is, an file was found in the provided directory}

      begin

        while (i < MAXDBSIZE) and ((pathname + s.name) <> listing[i-1]) do 

          begin

            listing[i] := pathname + s.name; {store absolute path in cell}

            i := i + 1; {Increment counter value}

            findnext(s); {find next file in directory}

          end;

        listptr := @listing;

        Glob := listptr^;

      end

    else {if no files are found...}

      begin

        writeln('No files in that directory!');

        exit;

      end;

  end;


procedure ListFiles(filelist : StrArray);

  var

    i : Integer;

  begin

    i := 1;

    while (i < MAXDBSIZE) and (filelist[i] <> '') do {while not end of array and filelist[i] not empyty}

      begin

        writeln(filelist[i]); {write filelist value to stdout}

        i := i + 1; {increment counter}

      end;

  end;



procedure PickleDB(filelist : StrArray);

  var

    i : Integer;

  begin

    i := 1;

    while (i < MAXDBSIZE) and (filelist[i] <> '') do {while not end of array and filelist[i] not empyty}

      begin

        writeln(TagDB, filelist[i]); {write filelist value to file}

        i := i + 1; {increment counter}

      end;

  end;



procedure AddFiles;

  var

    filelist : StrArray;

    pathname : String;

  begin

    writeln('What is the path to scan for the images?');

    readln(pathname);

    writeln('Globbing...');

    filelist := Glob(pathname);

    writeln('Listing...');

    ListFiles(filelist);

    writeln('PickleDB');

    PickleDB(filelist);

    writeln('Done!')

  end;



procedure BrowseFiles;

  begin

    writeln('Not yet implemented!');

    exit;

  end;

	

procedure UserInput;

  var

    inputchar : Char;

    loopcatch : Integer;

  begin

    loopcatch := 0;

    inputchar := ' ';

      repeat

        write('Do you want to [B]rowse, [A]dd, or [Q]uit? >>');

        readln(inputchar);

          case inputchar of

            'a','A': begin

                       AddFiles;

                       loopcatch := loopcatch + 1;

                     end;

            'b','B': begin

                       BrowseFiles;

                       loopcatch := loopcatch + 1;

                     end;

            'q','Q': begin

                       loopcatch := loopcatch + 1;

                       exit;

                     end;

          end;

      until loopcatch <> 0;

  end;

	  

begin {main}

  assign(TagDB, 'tags.dat'); {associate the variable TagDB with tags.dat file}

  rewrite(TagDB); {ready file for writing}

  UserInput; {call main user input subprogram}

  close(TagDB)

end. {main}

ImageCloud has a Green Light!

November 29, 2006

I finally got the review back on the ImageCloud proposal. The teacher green lighted it (as the title say 😉 ).

My Proposal:
—————-
Project Description:
ImageCloud was born out desperation. I thought the project up after going through my hard drive and finding folders of images that had no clean naming scheme. Like many digital cameras, they had names like DCM234620.JPG. Sure, Windows could rename them coming of the camera, but I don’t (won’t) use Windows.
The benefits of ImageCloud versus other photo album software are that unlike generic albums, ImageCloud takes a more human approach. People don’t usually categorize a single image off a single word. A picture of a forest could be described as “nature,” “trees,” “green,” “photo,” “streams,” or “forest.” With normal directory structures, this would require a large number of folders and sub-folders. This model is time consuming and unnatural to navigate. With ImageCloud, you would ‘tag’ a photo of a forest with the forementioned tags, and any single one would be able to recognize it. Clean, simple, and fast.
Expected Outputs:

  • List of photos matching tag
  • Gallery of photos matching tag (if we get that far in class)
  • Cloud of tags to browse by (if we get that far in class)

Required Inputs:

  • A list of files to store in the database
  • A directory of folders
  • List of tags per photo

Brief Code Description:
The code will consist of a set of procedures (or objects if we get into OOP). They will be responsible for searching through the directories for images [using findfirst / findnext or glob depending on the OS ran on], getting a list of tags per image, writing to / appending the database, and output.

The Response:
——————-
“OK, Greenlight.

Excellent idea. Althouh there are many photo albums out there this does have the unique twist that gives it the green light.

I would like a program like this.

BTW, do you envision renaming the files as well?

I do use the XP copy function to do that and create folders with sortable (by date) and descriptive names.
One problem I have with this is that it does not check for pre-exisiting files and will actually overwrite any with the same name – oops if you have also selected the Delete after copy function.
So recommend that you check for that.”

Crazy Pascal Assignment

November 8, 2006

My semester project in pascal is self assigned. I’ve written a proposal letter to the teacher to make ImageCloud in pascal. The python verison is not really even helpful in this besides being a psuedocode for the pascal. This is what I have so far. He hasn’t even green-lighted the idea yet. Here’s hoping…

program FileReader(input, output);

uses
    DOS;

const
    MAXDBSIZE = 224;
type
    StrArray = array [0..(MAXDBSIZE-1)] of String;

var
    pathname : String;
    filelist : StrArray;

procedure glob(var filelist : StrArray);
    var
	s : SearchRec;

        x : integer;
        pathname : String;
    begin

        x := 1;
        filelist[0] := ' ';

          Writeln('Please enter a directory to search in:');
	Readln(pathname);
        findfirst(pathname + '*.*', AnyFile, s);

	if s.name <> '' then
	  while (x < MAXDBSIZE) and (s.name <> filelist[x-1]) do

	    begin
	      filelist[x] := s.name;

              x := x + 1;
              findnext(s)

	    end
	else
          writeln('No files in that directory!');

        x := 1;

        while (x < MAXDBSIZE) and (s.name <> filelist[x-1]) do

          begin
            writeln(filelist[x]);
            x := x + 1;

          end;
    end;

procedure UserInput;
  var

    inputchar : char;
    foo, jello : integer;

  begin
    foo := 0;
    jello := 0;

    inputchar := ' ';
      repeat
        write('Do you want to [B]rowse, [A]dd, or [Q]uit? >>');

        readln(inputchar);
          case inputchar of
	    'a','A': begin

	      glob(filelist);
	      jello := jello + 1;

	      end;
	    'b','B': begin
	      glob(filelist);

	      jello := jello + 1;
	      end;
	    'q','Q': begin

	      glob(filelist);
	      jello := jello + 1;

	      end;
	  end;
      until jello <> foo;
  end;

begin {main}
UserInput;
end.

New Page

October 26, 2006

I don’t know that it pops up saying I made a new page, but I did. ImageCloud has its own page now. Yeah, over on your right. Might have to scroll down a little. I don’t know if I’ll host the src there, or off site. I want a free host, I’m cheap.