OSDN Git Service

やっとMySQLに画像を挿入できました。文字列にエンコードしました。主に原因は画像のサイズです。
authoryamat0jp <terukohietori@gmail.com>
Thu, 30 Jan 2020 11:42:58 +0000 (20:42 +0900)
committeryamat0jp <terukohietori@gmail.com>
Thu, 30 Jan 2020 11:42:58 +0000 (20:42 +0900)
けれどもまだサイズが大きいらしく、今度は画像が切れてしまいます。

18 files changed:
WebModuleUnit1.pas
sprites.png [deleted file]
tool/2019-03/IMG_0752.JPG [deleted file]
tool/2019-03/IMG_0753.JPG [deleted file]
tool/2019-03/IMG_0754.JPG [deleted file]
tool/2019-03/IMG_0755.JPG [deleted file]
tool/2019-03/IMG_0756.JPG [deleted file]
tool/2019-03/IMG_0757.JPG [deleted file]
tool/2019-03/IMG_0758.JPG [deleted file]
tool/2019-03/IMG_0759.JPG [deleted file]
tool/2019-03/IMG_0760.JPG [deleted file]
tool/2019-03/IMG_0761.JPG [deleted file]
tool/Project1.dpr
tool/Project1.dproj
tool/Project1.res
tool/Project1Resource.rc
tool/Unit2.dfm
tool/Unit2.pas

index fc777ba..feaf2dd 100644 (file)
@@ -785,8 +785,9 @@ begin
         [t, Request.ScriptName, j, s]);
       FDTable1.Next;
     end;
-    ReplaceText := '<div class="carousel-caption text-left" style="font-size:1.5rem">' + ReplaceText
-      + '</div>';
+    ReplaceText :=
+      '<div class="carousel-caption text-left" style="font-size:1.5rem">' +
+      ReplaceText + '</div>';
   end
   else if TagString = 'info' then
     ReplaceText := FDTable1.Lookup('dbnum', FDTable3.FieldByName('info')
@@ -1008,7 +1009,8 @@ procedure TWebModule1.WebModule1imgAction(Sender: TObject; Request: TWebRequest;
   Response: TWebResponse; var Handled: Boolean);
 var
   s: string;
-  res: TStream;
+  p: TBytes;
+  res: TMemoryStream;
 begin
   with FDTable5 do
   begin
@@ -1016,7 +1018,10 @@ begin
     Response.ContentType := 'image/jpeg';
     if Locate('name', s) = true then
     begin
-      res := CreateBlobStream(FieldByName('source'), bmRead);
+      s := FieldByName('source').AsString;
+      p := TNetEncoding.Base64.DecodeStringToBytes(s);
+      res := TMemoryStream.Create;
+      res.WriteBuffer(p, Length(p));
       Response.ContentStream := res;
     end
     else
diff --git a/sprites.png b/sprites.png
deleted file mode 100644 (file)
index b40ced0..0000000
Binary files a/sprites.png and /dev/null differ
diff --git a/tool/2019-03/IMG_0752.JPG b/tool/2019-03/IMG_0752.JPG
deleted file mode 100644 (file)
index aada3c4..0000000
Binary files a/tool/2019-03/IMG_0752.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0753.JPG b/tool/2019-03/IMG_0753.JPG
deleted file mode 100644 (file)
index 4dc94c4..0000000
Binary files a/tool/2019-03/IMG_0753.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0754.JPG b/tool/2019-03/IMG_0754.JPG
deleted file mode 100644 (file)
index 0d4b895..0000000
Binary files a/tool/2019-03/IMG_0754.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0755.JPG b/tool/2019-03/IMG_0755.JPG
deleted file mode 100644 (file)
index 73797a2..0000000
Binary files a/tool/2019-03/IMG_0755.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0756.JPG b/tool/2019-03/IMG_0756.JPG
deleted file mode 100644 (file)
index 8137c3f..0000000
Binary files a/tool/2019-03/IMG_0756.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0757.JPG b/tool/2019-03/IMG_0757.JPG
deleted file mode 100644 (file)
index 608cf44..0000000
Binary files a/tool/2019-03/IMG_0757.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0758.JPG b/tool/2019-03/IMG_0758.JPG
deleted file mode 100644 (file)
index 0bd2702..0000000
Binary files a/tool/2019-03/IMG_0758.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0759.JPG b/tool/2019-03/IMG_0759.JPG
deleted file mode 100644 (file)
index 1ea2e99..0000000
Binary files a/tool/2019-03/IMG_0759.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0760.JPG b/tool/2019-03/IMG_0760.JPG
deleted file mode 100644 (file)
index d4c95d2..0000000
Binary files a/tool/2019-03/IMG_0760.JPG and /dev/null differ
diff --git a/tool/2019-03/IMG_0761.JPG b/tool/2019-03/IMG_0761.JPG
deleted file mode 100644 (file)
index 44228aa..0000000
Binary files a/tool/2019-03/IMG_0761.JPG and /dev/null differ
index 5f95381..fd4bf51 100644 (file)
@@ -1,5 +1,13 @@
 program Project1;
 
+
+
+
+
+
+
+
+
 {$R *.dres}
 
 uses
index 50820d1..a263073 100644 (file)
             <Form>Form1</Form>
             <FormType>dfm</FormType>
         </DCCReference>
-        <RcItem Include="2019-03\IMG_0752.JPG">
+        <RcItem Include="Photos\IMG_0684.jpg">
             <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_1</ResourceId>
+            <ResourceId>JpgImage_1</ResourceId>
         </RcItem>
-        <RcItem Include="2019-03\IMG_0753.JPG">
+        <RcItem Include="Photos\IMG_0687.jpg">
             <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_2</ResourceId>
+            <ResourceId>JpgImage_2</ResourceId>
         </RcItem>
-        <RcItem Include="2019-03\IMG_0754.JPG">
+        <RcItem Include="Photos\IMG_0689.jpg">
             <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_3</ResourceId>
+            <ResourceId>JpgImage_3</ResourceId>
         </RcItem>
-        <RcItem Include="2019-03\IMG_0755.JPG">
+        <RcItem Include="Photos\IMG_0692.jpg">
             <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_4</ResourceId>
+            <ResourceId>JpgImage_4</ResourceId>
         </RcItem>
-        <RcItem Include="2019-03\IMG_0756.JPG">
+        <RcItem Include="Photos\IMG_0698.jpg">
             <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_5</ResourceId>
-        </RcItem>
-        <RcItem Include="2019-03\IMG_0757.JPG">
-            <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_6</ResourceId>
-        </RcItem>
-        <RcItem Include="2019-03\IMG_0758.JPG">
-            <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_7</ResourceId>
-        </RcItem>
-        <RcItem Include="2019-03\IMG_0759.JPG">
-            <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_8</ResourceId>
-        </RcItem>
-        <RcItem Include="2019-03\IMG_0760.JPG">
-            <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_9</ResourceId>
-        </RcItem>
-        <RcItem Include="2019-03\IMG_0761.JPG">
-            <ResourceType>RCDATA</ResourceType>
-            <ResourceId>Resource_10</ResourceId>
+            <ResourceId>JpgImage_5</ResourceId>
         </RcItem>
         <BuildConfiguration Include="Release">
             <Key>Cfg_2</Key>
                 </Source>
             </Delphi.Personality>
             <Deployment Version="3">
-                <DeployFile LocalName="2019-03\IMG_0760.JPG" Configuration="Debug" Class="ProjectFile"/>
-                <DeployFile LocalName="2019-03\IMG_0761.JPG" Configuration="Debug" Class="ProjectFile"/>
-                <DeployFile LocalName="2019-03\IMG_0753.JPG" Configuration="Debug" Class="ProjectFile"/>
-                <DeployFile LocalName="2019-03\IMG_0757.JPG" Configuration="Debug" Class="ProjectFile"/>
                 <DeployFile LocalName="2019-03\IMG_0756.JPG" Configuration="Debug" Class="ProjectFile"/>
+                <DeployFile LocalName="Win32\Debug\Project1.exe" Configuration="Debug" Class="ProjectOutput">
+                    <Platform Name="Win32">
+                        <RemoteName>Project1.exe</RemoteName>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="Photos\IMG_0692.jpg" Configuration="Debug" Class="ProjectFile">
+                    <Platform Name="Win32">
+                        <RemoteDir>.\</RemoteDir>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="2019-03\IMG_0758.JPG" Configuration="Debug" Class="ProjectFile"/>
                 <DeployFile LocalName="2019-03\IMG_0754.JPG" Configuration="Debug" Class="ProjectFile"/>
+                <DeployFile LocalName="Photos\IMG_0689.jpg" Configuration="Debug" Class="ProjectFile">
+                    <Platform Name="Win32">
+                        <RemoteDir>.\</RemoteDir>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="2019-03\IMG_0761.JPG" Configuration="Debug" Class="ProjectFile"/>
+                <DeployFile LocalName="2019-03\IMG_0755.JPG" Configuration="Debug" Class="ProjectFile"/>
+                <DeployFile LocalName="2019-03\IMG_0760.JPG" Configuration="Debug" Class="ProjectFile"/>
                 <DeployFile LocalName="2019-03\IMG_0759.JPG" Configuration="Debug" Class="ProjectFile"/>
+                <DeployFile LocalName="Photos\IMG_0698.jpg" Configuration="Debug" Class="ProjectFile">
+                    <Platform Name="Win32">
+                        <RemoteDir>.\</RemoteDir>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="2019-03\IMG_0753.JPG" Configuration="Debug" Class="ProjectFile"/>
+                <DeployFile LocalName="2019-03\IMG_0757.JPG" Configuration="Debug" Class="ProjectFile"/>
                 <DeployFile LocalName="Win32\Debug\Project1.exe" Configuration="Debug" Class="ProjectOutput"/>
                 <DeployFile LocalName="2019-03\IMG_0752.JPG" Configuration="Debug" Class="ProjectFile"/>
-                <DeployFile LocalName="2019-03\IMG_0758.JPG" Configuration="Debug" Class="ProjectFile"/>
-                <DeployFile LocalName="2019-03\IMG_0755.JPG" Configuration="Debug" Class="ProjectFile"/>
-                <DeployClass Name="AdditionalDebugSymbols">
-                    <Platform Name="iOSSimulator">
+                <DeployFile LocalName="Photos\IMG_0687.jpg" Configuration="Debug" Class="ProjectFile">
+                    <Platform Name="Win32">
+                        <RemoteDir>.\</RemoteDir>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="Photos\IMG_0684.jpg" Configuration="Debug" Class="ProjectFile">
+                    <Platform Name="Win32">
+                        <RemoteDir>.\</RemoteDir>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployClass Name="Android_SplashImage470">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-normal</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="OSX32">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
+                </DeployClass>
+                <DeployClass Name="DependencyModule">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
                     <Platform Name="Win32">
                         <Operation>0</Operation>
+                        <Extensions>.dll;.bpl</Extensions>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="AndroidClassesDexFile">
-                    <Platform Name="Android">
-                        <RemoteDir>classes</RemoteDir>
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="AndroidFileProvider">
-                    <Platform Name="Android">
-                        <RemoteDir>res\xml</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="AndroidGDBServer">
-                    <Platform Name="Android">
-                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                <DeployClass Required="true" Name="DependencyPackage">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="AndroidLibnativeArmeabiFile">
-                    <Platform Name="Android">
-                        <RemoteDir>library\lib\armeabi</RemoteDir>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.bpl</Extensions>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="AndroidLibnativeMipsFile">
-                    <Platform Name="Android">
-                        <RemoteDir>library\lib\mips</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="AndroidServiceOutput">
-                    <Platform Name="Android">
-                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                <DeployClass Name="iPad_Launch2048">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="AndroidSplashImageDef">
-                    <Platform Name="Android">
-                        <RemoteDir>res\drawable</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="AndroidSplashStyles">
-                    <Platform Name="Android">
-                        <RemoteDir>res\values</RemoteDir>
+                <DeployClass Name="ProjectiOSDeviceDebug">
+                    <Platform Name="iOSDevice">
+                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="AndroidSplashStylesV21">
+                <DeployClass Name="AndroidLibnativeMipsFile">
                     <Platform Name="Android">
-                        <RemoteDir>res\values-v21</RemoteDir>
+                        <RemoteDir>library\lib\mips</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_DefaultAppIcon">
-                    <Platform Name="Android">
-                        <RemoteDir>res\drawable</RemoteDir>
+                <DeployClass Name="ProjectOSXInfoPList">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_LauncherIcon144">
+                <DeployClass Name="AndroidGDBServer">
                     <Platform Name="Android">
-                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_LauncherIcon36">
-                    <Platform Name="Android">
-                        <RemoteDir>res\drawable-ldpi</RemoteDir>
+                <DeployClass Name="ProjectiOSResource">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="Android_LauncherIcon48">
-                    <Platform Name="Android">
-                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_LauncherIcon72">
-                    <Platform Name="Android">
-                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                <DeployClass Name="ProjectOSXEntitlements">
+                    <Platform Name="OSX32">
+                        <RemoteDir>../</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_LauncherIcon96">
-                    <Platform Name="Android">
-                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                <DeployClass Name="iPhone_Launch640">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="Android_SplashImage426">
-                    <Platform Name="Android">
-                        <RemoteDir>res\drawable-small</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_SplashImage470">
+                <DeployClass Name="Android_SplashImage960">
                     <Platform Name="Android">
-                        <RemoteDir>res\drawable-normal</RemoteDir>
+                        <RemoteDir>res\drawable-xlarge</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_SplashImage640">
+                <DeployClass Name="Android_LauncherIcon96">
                     <Platform Name="Android">
-                        <RemoteDir>res\drawable-large</RemoteDir>
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="Android_SplashImage960">
+                <DeployClass Name="Android_LauncherIcon144">
                     <Platform Name="Android">
-                        <RemoteDir>res\drawable-xlarge</RemoteDir>
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="DebugSymbols">
-                    <Platform Name="iOSSimulator">
+                <DeployClass Name="iPhone_Launch320">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="OSX32">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Win32">
-                        <Operation>0</Operation>
-                    </Platform>
                 </DeployClass>
-                <DeployClass Name="DependencyFramework">
-                    <Platform Name="OSX32">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
+                <DeployClass Name="UWP_DelphiLogo150">
+                    <Platform Name="Win64">
+                        <RemoteDir>Assets</RemoteDir>
                         <Operation>1</Operation>
-                        <Extensions>.framework</Extensions>
                     </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
+                    <Platform Name="Win32">
+                        <RemoteDir>Assets</RemoteDir>
                         <Operation>1</Operation>
-                        <Extensions>.framework</Extensions>
                     </Platform>
-                    <Platform Name="Win32">
-                        <Operation>0</Operation>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashImageDef">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="DependencyModule">
-                    <Platform Name="iOSDevice32">
+                <DeployClass Name="UWP_DelphiLogo44">
+                    <Platform Name="Win64">
+                        <RemoteDir>Assets</RemoteDir>
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
                     </Platform>
-                    <Platform Name="iOSDevice64">
+                    <Platform Name="Win32">
+                        <RemoteDir>Assets</RemoteDir>
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
                     </Platform>
-                    <Platform Name="iOSSimulator">
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeX86File">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\x86</RemoteDir>
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
                     </Platform>
+                </DeployClass>
+                <DeployClass Name="DebugSymbols">
                     <Platform Name="OSX32">
                         <RemoteDir>Contents\MacOS</RemoteDir>
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
                     </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
                     </Platform>
                     <Platform Name="Win32">
                         <Operation>0</Operation>
-                        <Extensions>.dll;.bpl</Extensions>
                     </Platform>
                 </DeployClass>
-                <DeployClass Required="true" Name="DependencyPackage">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
-                        <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
-                    </Platform>
-                    <Platform Name="iOSSimulator">
-                        <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
-                    </Platform>
+                <DeployClass Name="DependencyFramework">
                     <Platform Name="OSX32">
                         <RemoteDir>Contents\MacOS</RemoteDir>
                         <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
-                    </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
-                        <Operation>1</Operation>
-                        <Extensions>.dylib</Extensions>
+                        <Extensions>.framework</Extensions>
                     </Platform>
                     <Platform Name="Win32">
                         <Operation>0</Operation>
-                        <Extensions>.bpl</Extensions>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="File">
+                <DeployClass Name="Android_SplashImage426">
                     <Platform Name="Android">
-                        <Operation>0</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice32">
-                        <Operation>0</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
-                        <Operation>0</Operation>
-                    </Platform>
-                    <Platform Name="iOSSimulator">
-                        <Operation>0</Operation>
-                    </Platform>
-                    <Platform Name="OSX32">
-                        <RemoteDir>Contents\Resources\StartUp\</RemoteDir>
-                        <Operation>0</Operation>
-                    </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>Contents\Resources\StartUp\</RemoteDir>
-                        <Operation>0</Operation>
-                    </Platform>
-                    <Platform Name="Win32">
-                        <Operation>0</Operation>
-                    </Platform>
-                </DeployClass>
-                <DeployClass Name="iPad_Launch1024">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSSimulator">
+                        <RemoteDir>res\drawable-small</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="iPad_Launch1536">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSSimulator">
+                <DeployClass Name="ProjectiOSEntitlements">
+                    <Platform Name="iOSDevice">
+                        <RemoteDir>../</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="iPad_Launch2048">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
+                <DeployClass Name="AdditionalDebugSymbols">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                     <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="iPad_Launch768">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSSimulator">
-                        <Operation>1</Operation>
+                    <Platform Name="Win32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>0</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="iPhone_Launch320">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSSimulator">
+                <DeployClass Name="AndroidSplashStylesV21">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values-v21</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="iPhone_Launch640">
-                    <Platform Name="iOSDevice32">
+                <DeployClass Name="AndroidClassesDexFile">
+                    <Platform Name="Android">
+                        <RemoteDir>classes</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSDevice64">
+                </DeployClass>
+                <DeployClass Name="ProjectiOSInfoPList">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
                     <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="iPhone_Launch640x1136">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
+                <DeployClass Name="iPad_Launch1024">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
                     <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="ProjectAndroidManifest">
+                <DeployClass Name="AndroidServiceOutput">
                     <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="ProjectiOSDeviceDebug">
-                    <Platform Name="iOSDevice32">
-                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="iOSDevice64">
-                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
+                <DeployClass Name="Android_DefaultAppIcon">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
                 <DeployClass Name="ProjectiOSDeviceResourceRules">
-                    <Platform Name="iOSDevice32">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSDevice64">
+                </DeployClass>
+                <DeployClass Name="ProjectOSXResource">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\Resources</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="ProjectiOSEntitlements">
-                    <Platform Name="iOSDevice32">
-                        <RemoteDir>..\</RemoteDir>
+                <DeployClass Name="iPad_Launch768">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSDevice64">
-                        <RemoteDir>..\</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="ProjectiOSInfoPList">
-                    <Platform Name="iOSDevice32">
+                <DeployClass Name="AndroidLibnativeArmeabiFile">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSDevice64">
+                </DeployClass>
+                <DeployClass Required="true" Name="ProjectOutput">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSSimulator">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="ProjectiOSResource">
-                    <Platform Name="iOSDevice32">
-                        <Operation>1</Operation>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
                     </Platform>
-                    <Platform Name="iOSDevice64">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                     <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="ProjectOSXEntitlements">
-                    <Platform Name="OSX32">
-                        <RemoteDir>..\</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>..\</RemoteDir>
+                <DeployClass Name="Android_SplashImage640">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-large</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="ProjectOSXInfoPList">
-                    <Platform Name="OSX32">
-                        <RemoteDir>Contents</RemoteDir>
-                        <Operation>1</Operation>
+                <DeployClass Name="File">
+                    <Platform Name="iOSDevice">
+                        <Operation>0</Operation>
                     </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>Contents</RemoteDir>
-                        <Operation>1</Operation>
+                    <Platform Name="Android">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="ProjectOSXResource">
                     <Platform Name="OSX32">
-                        <RemoteDir>Contents\Resources</RemoteDir>
-                        <Operation>1</Operation>
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>0</Operation>
                     </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>Contents\Resources</RemoteDir>
-                        <Operation>1</Operation>
+                    <Platform Name="iOSSimulator">
+                        <Operation>0</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Required="true" Name="ProjectOutput">
-                    <Platform Name="Android">
-                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                <DeployClass Name="iPhone_Launch640x1136">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSDevice32">
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSDevice64">
+                </DeployClass>
+                <DeployClass Name="AndroidSplashStyles">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="iOSSimulator">
+                </DeployClass>
+                <DeployClass Name="AndroidFileProvider">
+                    <Platform Name="Android">
+                        <RemoteDir>res\xml</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Linux64">
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon36">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-ldpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="OSX32">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1536">
+                    <Platform Name="iOSDevice">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="OSX64">
-                        <RemoteDir>Contents\MacOS</RemoteDir>
+                    <Platform Name="iOSSimulator">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Win32">
-                        <Operation>0</Operation>
-                    </Platform>
                 </DeployClass>
-                <DeployClass Name="ProjectUWPManifest">
-                    <Platform Name="Win32">
+                <DeployClass Name="Android_LauncherIcon48">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Win64">
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon72">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <DeployClass Name="UWP_DelphiLogo150">
-                    <Platform Name="Win32">
-                        <RemoteDir>Assets</RemoteDir>
+                <DeployClass Name="ProjectAndroidManifest">
+                    <Platform Name="Android">
                         <Operation>1</Operation>
                     </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectUWPManifest">
                     <Platform Name="Win64">
-                        <RemoteDir>Assets</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                </DeployClass>
-                <DeployClass Name="UWP_DelphiLogo44">
                     <Platform Name="Win32">
-                        <RemoteDir>Assets</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
-                    <Platform Name="Win64">
-                        <RemoteDir>Assets</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
-                <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
-                <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
                 <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="iOSDevice" Name="$(PROJECTNAME).app"/>
                 <ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
                 <ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
                 <ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
-                <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
-                <ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
                 <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
             </Deployment>
             <Platforms>
                 <Platform value="Win32">True</Platform>
index 745984a..3836c9b 100644 (file)
Binary files a/tool/Project1.res and b/tool/Project1.res differ
index 47cdfc0..74dfe98 100644 (file)
@@ -1,10 +1,5 @@
-Resource_1 RCDATA "2019-03\\IMG_0752.JPG"
-Resource_2 RCDATA "2019-03\\IMG_0753.JPG"
-Resource_3 RCDATA "2019-03\\IMG_0754.JPG"
-Resource_4 RCDATA "2019-03\\IMG_0755.JPG"
-Resource_5 RCDATA "2019-03\\IMG_0756.JPG"
-Resource_6 RCDATA "2019-03\\IMG_0757.JPG"
-Resource_7 RCDATA "2019-03\\IMG_0758.JPG"
-Resource_8 RCDATA "2019-03\\IMG_0759.JPG"
-Resource_9 RCDATA "2019-03\\IMG_0760.JPG"
-Resource_10 RCDATA "2019-03\\IMG_0761.JPG"
+JpgImage_1 RCDATA "Photos\\IMG_0684.jpg"
+JpgImage_2 RCDATA "Photos\\IMG_0687.jpg"
+JpgImage_3 RCDATA "Photos\\IMG_0689.jpg"
+JpgImage_4 RCDATA "Photos\\IMG_0692.jpg"
+JpgImage_5 RCDATA "Photos\\IMG_0698.jpg"
index 97c70ec..97eec12 100644 (file)
@@ -17,8 +17,9 @@ object Form1: TForm1
   object Label1: TLabel
     Left = 48
     Top = 56
-    Width = 3
+    Width = 6
     Height = 13
+    Caption = '1'
   end
   object Label2: TLabel
     Left = 37
@@ -83,6 +84,7 @@ object Form1: TForm1
     Height = 21
     ReadOnly = True
     TabOrder = 3
+    Text = 'slide1.jpg'
   end
   object DBNavigator1: TDBNavigator
     Left = 312
@@ -224,7 +226,6 @@ object Form1: TForm1
   end
   object FDTable1: TFDTable
     Active = True
-    CachedUpdates = True
     IndexFieldNames = 'id'
     Connection = FDConnection1
     FetchOptions.AssignedValues = [evDetailCascade, evDetailServerCascade]
@@ -234,18 +235,22 @@ object Form1: TForm1
     TableName = 'images'
     Left = 392
     Top = 24
-    object FDTable1ID: TIntegerField
-      FieldName = 'ID'
-      Origin = 'ID'
+    object FDTable1id: TIntegerField
+      FieldName = 'id'
+      Origin = 'id'
       Required = True
     end
-    object FDTable1NAME: TWideStringField
-      FieldName = 'NAME'
-      Origin = 'NAME'
+    object FDTable1name: TWideStringField
+      AutoGenerateValue = arDefault
+      FieldName = 'name'
+      Origin = '`name`'
+      Size = 30
     end
-    object FDTable1SOURCE: TBlobField
-      FieldName = 'SOURCE'
-      Origin = '"SOURCE"'
+    object FDTable1source: TWideMemoField
+      AutoGenerateValue = arDefault
+      FieldName = 'source'
+      Origin = '`source`'
+      BlobType = ftWideMemo
     end
   end
   object OpenPictureDialog1: TOpenPictureDialog
@@ -289,10 +294,9 @@ object Form1: TForm1
     CachedUpdates = True
     Connection = FDConnection1
     SQL.Strings = (
-      'use kainushi;'
       'create table if not exists'
       ' images(id int primary key,'
-      ' name varchar(30), source longblob);')
+      ' name varchar(30), source longtext);')
     Left = 440
     Top = 112
   end
index 7aaeedf..d4e36cb 100644 (file)
@@ -35,9 +35,6 @@ type
     FDGUIxWaitCursor1: TFDGUIxWaitCursor;
     DBNavigator1: TDBNavigator;
     DBGrid1: TDBGrid;
-    FDTable1ID: TIntegerField;
-    FDTable1NAME: TWideStringField;
-    FDTable1SOURCE: TBlobField;
     Button4: TButton;
     FDQuery1: TFDQuery;
     Memo1: TMemo;
@@ -68,6 +65,9 @@ type
     FDTable3dbnum: TIntegerField;
     FDTable3database: TWideStringField;
     DataSource1: TDataSource;
+    FDTable1id: TIntegerField;
+    FDTable1name: TWideStringField;
+    FDTable1source: TWideMemoField;
     procedure Button1Click(Sender: TObject);
     procedure Button4Click(Sender: TObject);
     procedure Button3Click(Sender: TObject);
@@ -104,30 +104,19 @@ uses System.NetEncoding, IdHashSHA, IdHashMessageDigest, Jpeg;
 procedure TForm1.Button1Click(Sender: TObject);
 var
   i: Integer;
-  t, t2: TStream;
-  jpg: TJpegImage;
+  s: string;
+  t: TResourceStream;
 begin
   with FDTable1 do
   begin
-    jpg := TJpegImage.Create;
-    for i := 1 to 10 do
+    for i := 1 to 5 do
     begin
-      t := TResourceStream.Create(HInstance, 'Resource_' + i.ToString,
-        RT_RCDATA);
-      jpg.LoadFromStream(t);
-      AppendRecord([i, Format('slide%d.jpg', [i])]);
-      Edit;
-      t2 := FDTable1.CreateBlobStream(FDTable1.FieldByName('source'), bmWrite);
-//      TNetEncoding.Base64.Encode(t, t2);
-      jpg.SaveToStream(t2);
-      Post;
+      t := TResourceStream.Create(HInstance, 'JpgImage_'+i.ToString, RT_RCDATA);
+      s := TNetEncoding.Base64.EncodeBytesToString(t.Memory, t.Size);
       t.Free;
-      t2.Free;
+      AppendRecord([i, Format('slide%d.jpg', [i]), s]);
     end;
-    jpg.Free;
-    ApplyUpdates;
-    CommitUpdates;
-//    Refresh;
+    Refresh;
   end;
 end;
 
@@ -140,16 +129,20 @@ end;
 
 procedure TForm1.Button3Click(Sender: TObject);
 var
-  s: TStream;
+  s: TMemoryStream;
+  p: TBytes;
   j: TJpegImage;
 begin
-  if (FDTable1.Bof = true)or(FDTable1.Eof = True) then
+  if (FDTable1.Bof = true) or (FDTable1.Eof = true) then
     Exit;
-  s := FDTable1.CreateBlobStream(FDTable1.FieldByName('source'), bmRead);
+  p := TNetEncoding.Base64.DecodeStringToBytes(FDTable1.FieldByName('source')
+    .AsString);
   j := TJpegImage.Create;
+  s := TMemoryStream.Create;
+  s.WriteBuffer(p, Length(p));
+  s.Position := 0;
   j.LoadFromStream(s);
   Canvas.Draw(0, 0, j);
-  s.Free;
   j.Free;
 end;
 
@@ -159,9 +152,7 @@ begin
   begin
     while not((Bof = true) and (Eof = true)) do
       Delete;
-    ApplyUpdates;
-    Reconcile;
-    CommitUpdates;
+    Refresh;
   end;
 end;