Using CSS to "Crop" Images

| No Comments

Advantage: very fast, no extra memory cost,and very easy to learn.
Output: Original picture partially displayed, with html/css tags in source code

Example:
#photoclip {
position:absolute;
height: 100px;
width: 50px;
clip: rect(0px, 100px, 40px, 0px);
overflow: hidden;
background: url(yourimagelocation);
}

Here, the rect() function accepts 4 variables. first two are the coords of the starting point of the cropping rectangle. The last two are cropping width, and cropping height.

"Overflow:hidden" means it will hide everything else outside of the cropping rectangle.

then in the html, you need to call the css style in div:

and also you can define the "width" and "height" of the dive .


Disadvantage:
When right clicking the pic and save , it is still the original picture. It is not actually cropping it, but hiding part of the picture.

Just learned something new : Oracle has some multimedia database functions. These functions are "JAVA" functions. so It might be a little different from other oracle functions. Multi-media includes: different types of video, image, audio. I am suprised those files can be operated by Oracle. The ORDImage is a class to deal with picutres. the code below was my test of how to convert between this type and blob.


pid varchar2(10) default 'chenz';
v_id number default 0;
Photo blob default null;
Photo2 blob default null;
vx1 number default 0;
vy1 number default 0;
vx2 number default 0;
vy2 number default 0;
vw number default 0;
vh number default 0;
attributes clob;
img_mimeType varchar2(32);
img_contentLength integer;
fileFormat varchar2(32);
img_width integer;
img_height integer;
contentFormat varchar2(32);
compressionFormat varchar2(32);
image1 ORDSYS.ORDIMAGE;
image2 ORDSYS.ORDIMAGE;

opt varchar2(100) default null;
begin





DBMS_LOB.CREATETEMPORARY(attributes, TRUE, DBMS_LOB.CALL);
select max(id) into v_id from directory.staff_pic where name=pid;
select content into Photo from directory.staff_pic where id=v_id ;
for i in (select * from directory.staff_pic where id=v_id) loop
Photo :=i.content;
vx1:=i.x1;
vx2:=i.x2;
vy1:=i.y1;
vy2:=i.y2;
vw:=i.width;
vh:=i.height;
end loop;




opt:='cut='||vx1||' '||vx2||' '||vw||' '||vh||'';
-- htp.p(opt);

ORDSYS.ORDImage.getProperties(Photo,
attributes,
img_mimeType,
img_width,
img_height,
fileFormat,
compressionFormat,
contentFormat,
img_contentLength);





select ordsys.ordimage(ordsys.ordsource( photo, null, null, null, null, 1),
null, null, null, null, null, null, null)
into image1 from dual;
image1.setProperties( );

------------------------------------------------------------------------------
----------Code below is to convert Ordimage to Blob--------
------------------------------------------------------------------------------



photo2:=ordsys.ordimage.getContent(image1);

owa_util.mime_header('image/jpeg', FALSE, NULL);
wpg_docload.download_file(Photo2);
end test3;

end test;

Five Nines

| No Comments


Availability Downtime per Year
99% 87 hours and 36 minutes
99.5% 43 hours and 48 minutes
99.95% 4 hours and 23 minutes
99.99% 53 minutes
99.999% 5 minutes

-------------------------------------------------------
In my opinion, the 99.999 % is kinda impossible. I do not believe anyone can fix a server problem in five minutes. So basically it is saying , this server is super stable with no down time.

Printshop Meeting

| No Comments

We had a meeting with print shop and business about this new print shop app. We basically went through all the functions and details and talk about some potential features.

1. Cheri wanted to add a function that she can view invoices from previous years. Thats fairly simple and I can just add one view offering this option.

2. In the form, they need 2 fields "Account" & "Activity Code" to be editable, because a few accounts or activities are not attached with particular indexes. I am thinking of adding a local table to store these special accounts and activity code. When loading invoices, it will check this local table first to see if thers any special ones, otherwise load the default.

3. Darin and Cheri also wanted a JV number input box. As above, it also can be included in that local table.

4. The Index search didn't work , I guess it was due to the code changing i made last night. But anyway, i need to fix it. And next time don't change any code before presenting.

5. Two fake indexes are needed to hold the bills of city halls or something else. So I'll make DPSST and OTHER in the indexes table. ( maybe a job to update the table every July 1)

6. 2 print reports and a yearly Report are needed too. Print reports are kinda easy . The yearly reports shouldn't be hard, depends on what records are needed.

So anyway, seems I need to spend one more week on this project

1. print shop error
I got a error report from Darin that printing app is not showing students' credit and balance. I found out the perl script of loading balance on Bar isn't working. Adam told me only several computers can use that script. Print shop people can use it because they log into portal and loading the data on oracle.wou.edu to access this script.

because oracle server has been moved, so the script folder doesn't have it's new IP. After the new IP is added in, the problem is fixed.


2. Got bunch of directory error saying my code kept looking for some file ''XXX.jpg'' in folder and couldn't find them.
The program runs fun, but I guess that annoys Mike Ross a lot. :(
Im gonna check the code today..If it gives hundreds errors , i think the job or the directory failed. but if there are only several errors , then it might be bad coding that didnt catch all error possibilities.
From the feed back from Mike, "the number of errors received varies quite a bit - sometimes a lot of errors all at once, then times when no errors of this type are received at all. Overall, it's a fairly steady stream of errors, but not tons of errors all the time." I think it should be lack of enough error catch.

1000

| No Comments

1111aa

Printshop logics

| No Comments

I reviewed the printshop algorithm again since it has some bugs now. The original design was using portal id to pull the users' "ldap"s.

So here are two problems I have with this design:
1. It has to look through "portal.users" talbe (generated from "directory" table). In the portal talble, the particular user has only one portal ID. And his name cannot be found on our WOU online directory.

I wonder if "not classified" staff member should be included in these tables too.

2. The function transfer V number to ldap always pull one of the ID back no matter how many status a user has. But if he is a staff, the print shop credit are supposed to go to the department index.