Teknoloji Haberleri
DH
forum
mini
Uygulama ile
aç
Uygulama ile Aç
Giriş
Kayıt
DH Anasayfa
İndirim Kodu
Ara
Popüler
Foruma Git
Hakkımızda
Destek
Mobil Sürüm
Standart Site Görünümü
Bu Konuda
Tüm Forumlar
Web Tasarım - Programlama
Yazılım Geliştirme
Asp / Asp.NET
Bu Konuda
Bağlan:
Facebook
Google+
Twitter
Aşağı Git
Tüm Forumlar
Web Tasarım - Programlama
Yazılım Geliştirme
Asp / Asp.NET
File Upload ile Resim Exif Bilgileri
Bu konudaki kullanıcılar: 2 misafir, 1 mobil kullanıcı
0
Cevap
482
Tıklama
0
Öne Çıkarma
1. sayfa
File Upload ile Resim Exif Bilgileri
Cevap Yaz
Konuya Özel
Linkli Mesajlar
Seçkin Yorumlar
B
bahtiyar_h
Cevapla
Özel Mesaj
Şikayet
Mesaja Link
Takip Et
11 yıl
Onbaşı
Konu Sahibi
Aşağıdaki gibi kod bloğum var ancak büyük puntolarla belirlediğim satırdaki resim yolundan değilde File uploada eklediğim resmin bilgilerini alsın istiyorum nasıl yapacağımı bilemedim. Yardımcı olursanız sevinirim... File Upload ın ID si "fuResim"
---------------------------------------------------------------------------------
protected void btnResimEkle_Click(object sender, EventArgs e)
{
string resimAdi = "";//Resim için değişken tanımlıyoruz.
string uzanti = "";
string Modell = "";
string Odakk = "";
string Poz = "";
string F = "";
string ISOO = "";
if (fuResim.HasFile)
{
uzanti = Path.GetExtension(fuResim.PostedFile.FileName);//Bu metod ile resmin uzantısını elde ediyoruz.
resimAdi = Ayarlar.UrlSeo(txtResimAdi.Text) + "-Galeri-Resim-" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + uzanti; //Resmin adını "Başlık"tan alalım ve adını mümkün olduğunca uzatıp adına birde tarih ekleyelim.
fuResim.SaveAs(Server.MapPath("../Resimler/Galeri/gecici" + uzanti));//Resmi geçici olarak tempte tutuyoruz.
Bitmap MyPhoto = new Bitmap(@"C:\\resim.jpg");
PropertyItem[] props = MyPhoto.PropertyItems;
const int IDCamModel = 272;
PropertyItem MakeModel = MyPhoto.GetPropertyItem(IDCamModel);
Encoding ascii = Encoding.ASCII;
string Model = ascii.GetString(MakeModel.Value, 0, MakeModel.Len - 1);
Modell = Model.ToString();
MessageBox.Show(Modell);
const int OdakUzunlugu = 37383;
PropertyItem MakeOdak = MyPhoto.GetPropertyItem(OdakUzunlugu);
Encoding asciiOdak = Encoding.ASCII;
Int16 Odak = BitConverter.ToInt16(MakeOdak.Value, 0);
if (Odak >= 0 && Odak <= 6)
{
Odakk = Odak.ToString() + "0" + " mm";
}
const int PozSuresi = 33434;
PropertyItem MakePoz = MyPhoto.GetPropertyItem(PozSuresi);
Encoding asciiPoz = Encoding.ASCII;
Int16 Poz1 = BitConverter.ToInt16(MakePoz.Value, 0);
Int16 Poz2 = BitConverter.ToInt16(MakePoz.Value, 4);
if (Poz1 >= Poz2)
{
Poz1 /= Poz2;
Poz = Poz1.ToString();
}
Poz1 = (Int16)(Poz2 / Poz1);
Poz = "1/" + Poz1.ToString() + " sn.";
const int FDuragi = 33437;
PropertyItem MakeF = MyPhoto.GetPropertyItem(FDuragi);
Encoding asciiF = Encoding.ASCII;
if (BitConverter.ToInt16(MakeF.Value, 4) != 0)
{
Int16 F1 = (Int16)(BitConverter.ToInt16(MakeF.Value, 0) / BitConverter.ToInt16(MakeF.Value, 4));
Int16 F2 = (Int16)(BitConverter.ToInt16(MakeF.Value, 0) % BitConverter.ToInt16(MakeF.Value, 4));
F = "f/" + F1.ToString() + "." + F2.ToString();
}
const int ISOSpeed = 34855;
PropertyItem MakeISO = MyPhoto.GetPropertyItem(ISOSpeed);
Encoding asciiISO = Encoding.ASCII;
Int16 ISO = BitConverter.ToInt16(MakeISO.Value, 0);
ISOO = "ISO-" + ISO.ToString();
--------------------------------------------------------------------------------------------------------
1. sayfa
Hizmet kalitesi için çerezleri kullanabiliriz, DH'yi kullanırken depoladığımız çerezlerle ilgili
veri politikamıza
gözatın.
---------------------------------------------------------------------------------
protected void btnResimEkle_Click(object sender, EventArgs e)
{
string resimAdi = "";//Resim için değişken tanımlıyoruz.
string uzanti = "";
string Modell = "";
string Odakk = "";
string Poz = "";
string F = "";
string ISOO = "";
if (fuResim.HasFile)
{
uzanti = Path.GetExtension(fuResim.PostedFile.FileName);//Bu metod ile resmin uzantısını elde ediyoruz.
resimAdi = Ayarlar.UrlSeo(txtResimAdi.Text) + "-Galeri-Resim-" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + uzanti; //Resmin adını "Başlık"tan alalım ve adını mümkün olduğunca uzatıp adına birde tarih ekleyelim.
fuResim.SaveAs(Server.MapPath("../Resimler/Galeri/gecici" + uzanti));//Resmi geçici olarak tempte tutuyoruz.
Bitmap MyPhoto = new Bitmap(@"C:\\resim.jpg");
PropertyItem[] props = MyPhoto.PropertyItems;
const int IDCamModel = 272;
PropertyItem MakeModel = MyPhoto.GetPropertyItem(IDCamModel);
Encoding ascii = Encoding.ASCII;
string Model = ascii.GetString(MakeModel.Value, 0, MakeModel.Len - 1);
Modell = Model.ToString();
MessageBox.Show(Modell);
const int OdakUzunlugu = 37383;
PropertyItem MakeOdak = MyPhoto.GetPropertyItem(OdakUzunlugu);
Encoding asciiOdak = Encoding.ASCII;
Int16 Odak = BitConverter.ToInt16(MakeOdak.Value, 0);
if (Odak >= 0 && Odak <= 6)
{
Odakk = Odak.ToString() + "0" + " mm";
}
const int PozSuresi = 33434;
PropertyItem MakePoz = MyPhoto.GetPropertyItem(PozSuresi);
Encoding asciiPoz = Encoding.ASCII;
Int16 Poz1 = BitConverter.ToInt16(MakePoz.Value, 0);
Int16 Poz2 = BitConverter.ToInt16(MakePoz.Value, 4);
if (Poz1 >= Poz2)
{
Poz1 /= Poz2;
Poz = Poz1.ToString();
}
Poz1 = (Int16)(Poz2 / Poz1);
Poz = "1/" + Poz1.ToString() + " sn.";
const int FDuragi = 33437;
PropertyItem MakeF = MyPhoto.GetPropertyItem(FDuragi);
Encoding asciiF = Encoding.ASCII;
if (BitConverter.ToInt16(MakeF.Value, 4) != 0)
{
Int16 F1 = (Int16)(BitConverter.ToInt16(MakeF.Value, 0) / BitConverter.ToInt16(MakeF.Value, 4));
Int16 F2 = (Int16)(BitConverter.ToInt16(MakeF.Value, 0) % BitConverter.ToInt16(MakeF.Value, 4));
F = "f/" + F1.ToString() + "." + F2.ToString();
}
const int ISOSpeed = 34855;
PropertyItem MakeISO = MyPhoto.GetPropertyItem(ISOSpeed);
Encoding asciiISO = Encoding.ASCII;
Int16 ISO = BitConverter.ToInt16(MakeISO.Value, 0);
ISOO = "ISO-" + ISO.ToString();
--------------------------------------------------------------------------------------------------------